About the recurring invoices
From a mail conversation, a rough intro to recurring invoices:
The "recurring invoice" is not an invoice "per se" and it does not have any "issue date" to be defined by the user. When you create a "recurring invoice" , what you are really creating is a sort of a "automatic invoice generation template"...
When you create a new "recurring invoice" you define a lot of data invoice-style (items info, customer info, etc..), and also some time parameters (when to start, periodicity, etc...); the start time define when the system should start to create invoices based on the pattern defined by the recurring you just created (that is, customer and items data), and the periodicity data define how long the system has to "wait" until it generates a new invoice with the same inovice data again.
However, the web application can not "schedule" jobs, because of the nature of a web application itself, so we set up a task to be executed regularly (daily or so). that task checks for the "pending invoices".
A "pending invoice" is an invoice that according to some recurring invoice , should be generated by now. If you run the "create-pending-invoices" daily, well , then everyday the invoice generation defined in you recurring invoices should occur.
Let's see an example: you create a recurring invoice called "hosting services", which has an item called "web server rental", which has the price of 100$. You want it to have a monthly periodicity, and you set up a start date of april 1 , 2010.
Once you've created this recurring, if you run the "create pending invoices" now, nothing will happen, since the recurring is set to start generating invoices on april 1.
let's say today is april 1:
- If you do nothing, nothing will happen. Although the system is supposed to generate a "hosting services" invoice , since it does not have a scheduling facility, it won't happen unless it's told to do so.
- If tomorrow, april 2 you issue the "create pending invoices", then the system would find 1 pending invoice (the "hosting services" one, which should have been generated on april 1 , the day before), so it generates it.
- If you run the task again on april 3, nothing would happen, because there is no invoice that should be generated and hasn't been on any date previous than april 3 .
- This same reasoning applies if you had run the task on april 1. the system would find that it should have generate an invoice by april 1 and so it would be listed as "pending" and generated accordingly.
- If you keep running that task everyday, nothing would happen until May 1, because, according to the "one month" periodicity you set up on the recurring invoice, now it's time to generate another "hosting services" invoice, so it would be generated.
- If, whatever the reason, you or your cron daemon forgot to run the task on may 1, and run it on may 2 instead, the system would have found out there is one "pending invoice" and would have generated it.
The "generate pending invoices" button which appears on your recurring invoices listing, works the same way (NOTE: The button only appears if you do have pending invoices).

