WHMCS Continuous Invoice Generation for active services only
WHMCS has a configuration option named 'Continuous Invoice Generation'. When enabled WHMCS will continue to generate invoices each cycle for services that are not already Cancelled or Terminated even if the previous invoice is Unpaid. This also means that WHMCS will continue to generate invoices for Suspended services as well.
We found ourselves wanting 'Continuous Invoice Generation' enabled, but did not want to continue to invoicing services that are Suspended. We decided to pay WHMCS to add this functionality. Below are the steps required to enable 'Continuous Invoice Generation' for only Active services.
The first step is to login to the admin area of WHMCS. Click 'Setup' and then 'General Settings' from the top navbar. Next click the 'Invoices' tab and then tick the 'Continuous Invoice Generation' option. Your WHMCS installation will now continue to generate new invoices for services that are not Cancelled or Terminated even if the previous invoice is Unpaid.
Next, we need to add a few configuration lines to the configuration.php file. Open your configuration.php file and add the following lines before the closing php tag.
global $continuous_invoicing_active_only; $continuous_invoicing_active_only = true;
Your configuration.php file should now look something like this
<?php $license = "xxxxx-xxxxxxxxxxxxxxxx"; $db_host = "localhost"; $db_username = "whmcs"; $db_password = "secret_password"; $db_name = "whmcs"; $cc_encryption_hash = "abcdefghijklmnopqrstuvwxyz1234567890"; $templates_compiledir = "templates_c/"; global $continuous_invoicing_active_only; $continuous_invoicing_active_only = true; ?>
Congratulations! Your WHMCS installation will now only continue to generate invoices for services that are Active!