Overview of invoices

I am making a overview of all my invoices that I need to send in the future to my customers. In that overview I want to have every id of my sql table to be showed as name. I already have done that. I only need to make the feature that it repeats every month so I can know when to send the invoices. I have 3 invoices. The first invoice needs to be repeated every month. If the invoice is not payed, I need to have the option to select ‘not payed’. And if the option not payed is selected It needs to count 7 days further and then I need to have the option again to add payed/not payed. If it is still not payed it needs to count 14 days further and after the 14 days it needs to reset it to the same date as the first invoice. If ‘payed’ is selected on all 3 invoices it needs to repeat from the same date as the first invoice. What option can I use to make this?

Have no idea what all that means, but, just save the date, current date as a datetime field.
Then, if paid, change the date for 30 more days. The logic of this is odd. What is is useful for?

I have updated my question please look at it now.

How are you receiving payments?

I believe I said this before, I would look at automating this so you don’t have to worry about doing this.

I am receiving them cash or by bank account. It depends on the user. It is only for myself to see on what date I need to send the invoices again. I need to click paid/not paid. I dont know how to make the paid/not paid buttons and repeat them every month and 7 days and 14 days.

Well, first, for accounting records ALL invoices should be kept for a certain number of years so that you can back trace them. Mostly so you can see a user’s passed payments and for taxes or income records. So, normally, you would have each invoice kept separated from the user records. A simple invoice table that would keep a record of all invoices.

In the user table, you would just have one flag that would indicate if the user is a live member, a temporary member for one week or a locked out member for non-payment.

Then, for the weekly processing, you would check if the member is live, pending payment or locked out. If live, check for an open invoice, if not one, create it. (In the invoice table it would show paid or not so you can query open invoices only.) In this weekly processing section you would have the logic to check for a one-week processing or full payment processing and handle changes in the invoice.

All of these ideas depend on how payments are made. It sounds like you are just using checks and give the user a free week if they sent in a payment. You might want to use Paypal and have it automated. That way the user can just have the 30 day payment taken out of their credit card or bank account without thinking about it at all. Payment structures are normally designed so you always get your payments on time.

Thank you very much for the explanation. In the invoice I have added my bank account data so the user knows how to send the money to me. And I am sending the invoices by mail. I am using phpmailer to send the emails to the users. The invoices are made with mpdf. So I will have the option to track them in my own mail. And all the users need to pay every month. Because I am renting houses. Do you know how I can make this the best way?

For renting real estate? I wouldn’t even send an email out unless they are late. I have never received a bill, invoice, or any other instrument for a rental.

In my case I need to send it to them every month, and if they are late I send them the second invoice, and if the second invoice (reminder) is also not payed I will send him the last invoice reminder.

Well, you didn’t mention it was for rental units. If you are renting on a weekly basis, you need to keep complete records of everything in case you need to show them. If you are in a country that has strict rules for keeping these records, you should read them.

For most cases, you would need to keep payment records based on each renter. So, you would have a table of the renter with all of their info such as mailing address, rental address, rental status and all personal info that you feel you need to keep. In that table, you would have an “ID” field. That would be used to flag the invoice table. You would have a user-ID field in the invoice table. That would allow you to select all invoices for any one renter to list and review.

You would also have to create another page that would scan for expiring invoices and create them as needed. For example, you would need to run this page weekly and look at paid invoices and pull out ones that are due within the next week to send out new invoices to the renters. Since it appears that you are dealing with people who pay by check monthly, you are spending a lot of time dealing with invoices. But, it can be automated. Have you coded any of it yet?

Yes I have created a sql database with the table ‘Info’. In that table I have every information stored of each individual user(e-mail, phone number, the amount of money he needs to pay every month etc…). I still need to make the table for the invoices. But I don’t know how to make it. I need to echo out the Name of the user and the location of the house. And after that I need to have a day counter that will automatically count 1 month. If the counter is done with counting the month. It needs to give me the option to send the e-mail to the user. And it needs to hold it for 14 more days. So the user has time to pay it. After the 14 days. I need to get a message called: Is it payed yes/no. If it is payed it needs to continue counting the next month. If it is not payed I need to have a option where I can email the second invoice reminder. And If I press e-mail it needs to hold if for 7 days. And then ask me again: is it payed yes/no. If it is payed it needs to continue counting. If it is not payed I need to have my last option to email the user the third invoice reminder. And after the e-mail is sent. It needs to repeat it every month in the same way.

I could actually add to this a great deal and make it a fully functioning property management suit…

Renter

  • holds details of renter
  • renter status

Property

  • holds details of the property.
  • property status

Agreement

  • this binds the renter/s to a property and has the details that are specific to a lease/ rental; such as term, rental amount, location of singed agreement, ect.

Invoice

  • template used
  • agreement id
  • date paid
  • amount paid

Notification

  • invoice id
  • date sent
  • method used

Status

  • all status’s whether it be for renter, property, notification, whatever

Next is cron jobs. How you want to set these up is up to you. You can define a rules engine and only use a single file that decides what and when to send, or break this into different jobs run at the 1st, 14th, and 21st.

For the first job: It gets all current renters with active properties and emails a standard invoice that is populated from the database. It adds a record to the notification table on successful send.

Second job: Gets all renters with active properties that have a status of not paid, worded however you want (‘SENT’, ‘NOT PAID’, ect). It also adds a record to the notification table on successful send.

Last email: Same as second but using a different template.

You now have a document collection system.

1 Like

Thank you so much this is so useful. I have another question, in my table I have a row called '‘pand’. In that row I put the addresses of the houses I am renting. Is it possible to rent multiple houses to one user. And if it is possible. How can I make invoices for the different houses instead of only 1 house?

Seems an odd question to ask if you are the landlord.

Yes I am the landlord. But these are small houses. Some people have bought 2 of them. That is why I asked this question.

My table structure allows for that. You adding the property info to the renter in the way you are doing, what happens if they move from one property to another? How do you keep track?

533578, When you create a table, you normally assign an “ID” field. This is used to mark a row uniquely. This field is normally an “auto-increment” field. Therefore, if you use an ID field in a the renter’s table, you would use that id in property table as the current owner or current renter. This means that several different properties could be assigned to one renter id. Quite easy to do.

It is fun to create your own software, but, you might want to use a template. There are thousands of them around at all prices. A short run at google and here are a couple that might save you a lot of time:
https://code-projects.org/house-rental-management-system-in-php-with-source-code/
https://www.kashipara.com/project/php/2834/house-rent-management-system-php
https://sourceforge.net/projects/hoteldruid/
All of these are PHP versions and all have lots of options you can use or remove as needed.
Might help save you some time!

1 Like

Thanks for the link! I will send my table structure so you guys can see what I have made:

id type: int(11)
Naam type: varchar(255)
Achternaam type: varchar(255)
Bedrijfsnaam type: varchar(255)
Adres type: varchar(255)
Postcode type: varchar(255)
Woonplaats type: varchar(255)
Telefoon type: varchar(255)
Email type: varchar(255)
Betalingsperiode type: varchar(255)
Bedragperperiode type: varchar(255)
Pand type: varchar(255)
Huisnummer type: varchar(255)
Deel type: varchar(255)

The field ‘Pand’ Is the address of the house I am renting. I would like to add multiple addresses to the same field. The field ‘Bedragperperiode’ is for the amount of money he needs to pay every month. The field ‘Huisnummer’ and ‘Deel’ are made for the housenumbers and for the specifik place he is renting. How can I add multiple houses to the ‘Pand’. And is there any possibility that I can have a page where I store all the houses And if a house is rented I can see the user it is rented to. And if it is not rented it need to see ‘Not rented’?

Well, normally, as Astonecipher mentioned, you need several tables, not just this one.
You would need to have one table just for renters alone. This would have their names and personal information. In forms on the webpages, you would use this to select a renter and place into a property or house. You would then have a table of properties/houses/apartments that would have all of the locations that you rent out. And, then an active list of all current renters for each location.

The reason you do this is to make it easier to access each. If you purchase a new house or a new renter wants to rent, you go to the correct page to handle that data. Astonecipher explained this in a list above. To create a full property management system can be quite a big job. That is why I suggested using a template. If you want to do this yourself from scratch, several tables as he mentioned above. One table for each main area needed. Then, you use the “id” values to place into the other tables as needed.

The names of the fields are in Dutch, I think, so they are easy for us to understand. But, I think you should make a decision if you want to build this totally from scratch or use a template which already has all the possible tables in place. I feel you may not understand how to link tables together.

Correct I have never linked tables together. I think the free template works better for me. I have installed this template : https://code-projects.org/house-rental-management-system-in-php-with-source-code/
But I am having trouble now connecting all of this to my database. I am using 000webhost to host my website. What can I do to make this work? Because the person who made this gave a tutorial on how to connect it to your own computer with xampp.

Sponsor our Newsletter | Privacy Policy | Terms of Service