Sam666 Posted February 10, 2023 Share Posted February 10, 2023 Hello, I am trying to manually generate invoice by clicking `Invoice Selected Items`, however the WHMCS didn't generated any invoice, but the related service `nextinvoicedate` was added one cycle. I have read the docs about the billing logic, and investigated on MySQL tables, according to the billing logic it should generate a invoice, but not sure why didn't. Below are my step by step investigation. Appreciate if anyone can help. Analyzes the Next Due Date of all Active and Suspended services. [true] Determines whether the date is equal to or less than the number of days in the future, based on the Invoice Generation setting. [true] mysql> SELECT id, domainstatus, nextduedate, nextinvoicedate, NOW() AS Now FROM tblhosting WHERE id=1047 AND nextduedate < NOW(); +------+--------------+-------------+-----------------+---------------------+ | id | domainstatus | nextduedate | nextinvoicedate | Now | +------+--------------+-------------+-----------------+---------------------+ | 1047 | Suspended | 2022-12-29 | 2023-01-29 | 2023-02-10 20:57:20 | +------+--------------+-------------+-----------------+---------------------+ 1 row in set (0.00 sec) Ensures no invoice item exists for the service on the next due date. true mysql> SELECT COUNT(*) AS invoice_item_equal_next_due FROM tblinvoiceitems WHERE relid=1047 AND duedate=(SELECT nextduedate FROM tblhosting WHERE id=1047); +-----------------------------+ | invoice_item_equal_next_due | +-----------------------------+ | 0 | +-----------------------------+ 1 row in set (0.00 sec) Triggers the InvoiceCreation Action Hook point. Triggers the InvoiceCreationPreEmail Action Hook point. Sends the Invoice Created email to the client. Triggers the InvoiceCreated Action Hook point. Increments the Next Invoice Date of the service by one billing cycle. When I click Invoice Selected Items, then 0 Invoices Created , but the service nextinvoicedate, was added a cycle which is 2023-03-01. https://docs.whmcs.com/Billing_Logic 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.