Sam666 Posted January 7, 2023 Share Posted January 7, 2023 Hello, I was tried to mannually generated the invoice for a service, the service next due date is 2022-12-07, and I have also check the 'tblhosting' table both the nextduedate and nextinvoicedate are 2022-12-07, then I click 'Invoice Selected Items' but no invoice being generated(the service status is Active), however the 'tblhosting' table's nextinvoicedate has been set to 2023-01-07 after clicked 'Invoice Selected Items'. According the blling logic, it should generate a invoice, I couldn't find the root cause why no invoice being generated. Appreciate if anyone can help. Analyzes the Next Due Date of all Active and Suspended services. [True, the service is Active and Next Due Date is 2022-12-07] Determines whether the date is equal to or less than the number of days in the future, based on the Invoice Generation setting. [True, the current date is 2023-01-07] Ensures no invoice item exists for the service on the next due date. [True, there's only one invoice for this service and the invoice item duedate is 2022-11-07] Generates a new invoice if the system evaluates the above points as true. https://docs.whmcs.com/Billing_Logic 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted January 7, 2023 Share Posted January 7, 2023 If I remember correctly, if tblinvoiceitems.relid already hosts the ID of the service in question for current date, no invoice will be issued. Let me explain. Let's say you generate an invoice for service Id 10. Few moments later you delete the invoice. The deletion removes the invoice from tblinvoices table but still leaves the item in tblinvoiceitems. This prevents WHMCS to reissue the invoice for service Id 10 since it already exists in tblinvoiceitems for current date. I am not up to date with latest versions of WHMCS but this is how it worked in past. In order to reissue the invoice of the above example, I need to delete tblinvoiceitems.relid = 10 for current date. 0 Quote Link to comment Share on other sites More sharing options...
Sam666 Posted January 7, 2023 Author Share Posted January 7, 2023 1 hour ago, Kian said: If I remember correctly, if tblinvoiceitems.relid already hosts the ID of the service in question for current date, no invoice will be issued. Let me explain. Let's say you generate an invoice for service Id 10. Few moments later you delete the invoice. The deletion removes the invoice from tblinvoices table but still leaves the item in tblinvoiceitems. This prevents WHMCS to reissue the invoice for service Id 10 since it already exists in tblinvoiceitems for current date. I am not up to date with latest versions of WHMCS but this is how it worked in past. In order to reissue the invoice of the above example, I need to delete tblinvoiceitems.relid = 10 for current date. Hello @Kian, thank you for your reply. Yes it's due to the previousely deleted invoice items still remain on the tblinvoiceitems table, but those invoice items cannot be viewed on the client/service/invoice page. I have just manually find out on MySQL and deleted unnecessary invoice items, the the invoice can be generated now. Thanks again. 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.