Knowledgebase: WHMCS Common Questions.
Posted by Chris W. on 06 July 2008 10:18 PM
Automatic Invoice Generation
WHMCS automatically generates invoices for products and services that are due in advance of the due date. Exactly how far in advance they generate you can configure yourself in Config > Automation Settings but by default it is 14 days.
The cron performs the generation each day so it is important you have this configured for it to work.
Invoice Reminders & Notices
WHMCS will send one reminder after generation but before the due date if the invoice has not been paid and then up to 3 overdue notices once the due date has passed. These can be used to warn the user about an upcoming suspension or termination of service. You can configure exactly which days these notices go out on again in Config > Automation Settings.
Creating Custom Invoices
With WHMCS, you can generate an invoice whenever you want. This is very useful for many reasons, some examples are:
The steps to do this are below...
Grouping Items into a Single Invoice
WHMCS will automatically group products & services, addons and domains with the same due date onto a single invoice for the customer. This means the customer only needs to make one transaction making it easier for them and reducing your transaction fees.
Continuous Invoice Generation
Continuous Invoice Generation refers to whether invoices are created for items that are unpaid. It is best explained through the use of an example.
Take for example a hosting account paid monthly. The user places their order in January. They receive an invoice and they pay their invoice. In the following month, the user gets their next invoice and they pay that. Then in March, the user receives their invoice but they don't pay it because they no longer wish to use the account or simply because they miss the emails about it. With continuous invoice generation disabled, the user would not receive any furthur invoices until the March invoice has been paid. However, with continuous invoicing enabled, the user would receive invoices every month until the account is set to terminated, regardless of whether the item has been paid for or not.
Enabling Continous Invoicing
To enable this feature, go to Configuration > General Settings > Invoicing and tick the checkbox next to this setting. After enabling this option, if there are then users who are due invoices for months which have not yet been invoiced, there will be one invoice generated on each cron run for the user for the following days after enabling this.
Proforma Invoicing/Sequential Invoice Numbering
This feature is primarily aimed at EU based companies where for accounting reasons, it is sometimes necessary to ensure paid invoice numbers are sequential. This feature in WHMCS can of course be used by all though.
Enabling Sequential Invoice Numbering
That's all there is to it! Sequential invoice numbering is now enabled and each time an invoice is paid, the next number in the sequence will be applied.
The sequential numbering is most often used in conjunction with proforma invoicing. If you want to do this, then you need to make a few template changes aswell to reflect the different names - Proforma invoice when unpaid and Invoice once paid. Instructions can be found in the viewinvoice.tpl and pdfconfig.php files where the changes need to be made - just need to uncomment the commented out code you will find in those files.
If you are using a merchant gateway, support may be built into WHMCS to allow you to issue a refund without logging into your gateway. If this is supported with the gateway, on a paid invoice in the admin area you will see a "Refund Invoice" button. If clicked, this button will issue a refund for the payment made towards that invoice and set it's status to Cancelled. This will not reverse the actions that were carried out as a result of the payment - for example changing the next due dates back or cancelling domain renewals/unsuspensions.
Setting the Starting Number
WHMCS allows you to set the next invoice number that is generated. This is useful for if you want to start invoicing at a number other than 1 or start invoices for a new year from a new number. You do this as follows:
The value will then disappear from the field but the next invoice will be assigned that number.