By default, an invoice is created by order ID in Phoca Cart. Order ID is an auto increment number. This means that it is automatically created in database and is unique number. A number series does not change by deleting an item, and deleted numbers are not replaced.
But billing can be even set on annual or monthly basis in parameter 'Method Of Creating Invoice Number'
If 'Method Of Creating Invoice Number' parameter is set to annual or monthly basis, following additional rules are applied:
- Every year or every month starts from one (1).
- When the last invoice is deleted, the next invoice gets its number
- When an earlier invoice is deleted, a blank space remains
- Order numbers are not equal to invoice numbers
- IMPORTANT!: 'Invoice Number Format' parameter needs to be set correctly:
- Annual basis - variable {year} must be included to avoid colliding with invoice numbers of another year, example: {prefix}{year}{orderid}{suffix}
- Monthly basis - variable {year} and {month} must be included to avoid colliding with invoice numbers of another year and month {prefix}{year}{month}{orderid}{suffix}
- The prefix should not contain numbers so that it does not conflict with year, month or order number
- Set the billing method ('Method Of Creating Invoice Number' parameter) at the beginning of using Phoca Cart and do not change it while using it
This applies analogously to the following parameters:
- Method Of Creating Order Numbers
- Method Of Creating Receipt Numbers
- Order Number Format
- Receipt Number Format
Parameter 'Create Invoice Number Based On Order Status'
If creating of invoice number is set up on an annual or monthly basis and order status is selected for this parameter, invoice will only be created after the order status has been changed.
The 'Create Invoice Number Based On Order Status' parameter will be set to: 'Complete'.
When the order is processed then order number is created. The invoice number will remain blank (as well as other invoice details - e.g. Invoice Date, Invoice Due Date, etc.). When the invoice status changes to 'Completed', an invoice number is created.
But it also means that:
- Invoice number may be completely different from the order number
- It can even happen that the order number 10 will have an invoice number 9 and the order number 9 will have an invoice number 10 - it does not depend on the sequence of the orders but on previously completed order (order number 10 can be completed before order number 9)
- You can edit the formatted invoice number but not the internal invoice number. If you enter formatted invoice number manually, the internal invoice number is not created and basically this number gets the following order (because the highest last invoice number is automatically detected)
- If invoice should be sent in email as attachment and it does not have a number (it has not been issued yet), then the invoice will will be not a part of the email because it does not exist.
- If invoice has not been issued yet, variables like {invoicedate} (Invoice Date), {invoiceduedate} (Invoice Due Date) or {invoicetimeofsupply} (Date Of Taxable Supply) will be empty.