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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.