Troubleshooting Service Invoice Generation

You may encounter a problem in which the system does not generate an  invoice for a service renewal. This is generally due to one of several  common causes.

For more information on how WHMCS generates invoices, see Billing Logic.

Status Not Active or Pending

The system only generates renewal invoices if Status is Active or Pending. Service records with other statuses will not generate renewal invoices.

If you have enabled Continuous Invoice Generation, the system will only generate renewal invoices if Status is Active.

To set this value:

1. Go to Clients > Products/Services.

2. Search for and click on the service.

3. Set Status to Active.

Domain Status Active

4. Click Save Changes.

The system will generate the renewal invoice the next time that the daily automation cron tasks run.

Cancellation Requested

The system will not generate new renewal invoices if there is a cancellation request. If it had already generated a renewal invoice at the time of the cancellation request, the system may have cancelled it due to your automation settings.

To check for this:

1. Go to Clients > Products/Services.

2. Search for and click on the service.

3. Look for a Cancellation Request Notice message:

Service with a Cancellation Request Notice

If you do not want to cancel the service, see Voiding Cancellation Requests.

Next Due Date Beyond Invoice Generation Days

A service record will not automatically generate a renewal invoice if Next Due Date is further in the future than the number of days that you specified for Invoice Generation.

To check for this:

1. Go to Configuration > System Settings > Automation Settings.

2. Find Invoice Generation and note the current value:

Automation Settings 14 Days

3. Go to Clients > Products/Services.

4. Search for and click on the service.

5. Find Next Due Date and check whether it is further in the future than Invoice Generation specifies.

Next Due Date 14/01/2022

For example, if today's date is January 1st, 2023:

Next Due Date: 14th Jan 2023
Invoice Generation: 14
= Invoice will generate today.
Next Due Date: 15th Jan 2023
Invoice Generation: 14
= Invoice not generated today.

If the invoice is not yet due for automatic renewal, you can renew the service early via the client's profile's Summary tab.

Previously Invoiced

A service will not automatically generate a renewal invoice if the system has already generated a renewal invoice for the current Next Due Date value and an admin deleted it.

To check for this issue:

1. Access the WHMCS MySQL® database using your preferred method (for example, phpMyAdmin).

2. Run the following query:

SELECT * FROM tblinvoiceitems WHERE type='Hosting' AND relid='x' AND invoiceid NOT IN(SELECT id FROM tblinvoices)

Replace x with the service ID, which you can find next to the service in the client's Summary tab.

The query should return an empty result:

phpmyadmin showing a success result

If there are any results, this indicates a deleted renewal invoice.

Review the client's profile's Log tab's Invoice Deleted or Order Deleted entries. This will identify who deleted it and the time of deletion.

To resolve this issue and generate a new invoice:

1. Go to Domains > Products/Services.

2. Search for and click on the service.

3. Set the Next Due Date value to one day earlier.

4. Click Save Changes.

The system will generate the renewal invoice the next time that the daily automation cron tasks run.

Daily Automation Cron Issue

The daily cron job handles invoice generation, payment reminders, and account suspensions and terminations according to your automation settings. If some of these do not occur, the cron job may not be running successfully.

For more information, see Verify That Your System Cron is Being Invoked.