Jump to content

invoicing script


hakimserwa

Recommended Posts

You want to know the whole idea behind invoicing?

 

You send someone a bill for services or products delivered or to be delivered.

 

What you're asking for in your OP is very specific and you won't find a tutorial for it because you will need to tailor it to you. You can find individual pieces but it's up to you to make them work together.

Link to comment
https://forums.phpfreaks.com/topic/265965-invoicing-script/#findComment-1362887
Share on other sites

You'll need cronjob's or some other technique to create those monthly/weekly/whatever-ly invoices.

That cronjob should start a PHP script which creates your invoices (DB entries) - loads a template of a PDF fills some information in (there are thousands of PDF-librarys out there) and sends it via mail.

 

For what do you need a tutorial now?

Link to comment
https://forums.phpfreaks.com/topic/265965-invoicing-script/#findComment-1364185
Share on other sites

Just some very basic stuff I quickly wrote down.

Imagine products are renting servers and stuff.

 

Table customers (id, name, email, locked, registration_date)

Table products (id, name, price, description, picture)

Table active_products (id, customer, productid, duration_date)

Table invoices (id, customer, productid, creation_date, due_date, paid)

 

Your cronjob will INSERT a new row INTO invoices FOREACH active_products WHERE duration_date > today.

In your application you SELECT invoices WHERE paid = 0 and customer = logged in user, and if there's any row -> tell the user.

 

Edit: Just to clearify, when a customer buys a server for 1 month you INSERT a row into active products with duration = date+30days or so

Link to comment
https://forums.phpfreaks.com/topic/265965-invoicing-script/#findComment-1364191
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.