KNK Posted February 14, 2022 Share Posted February 14, 2022 Hello. So after I truncated the invoices db of WHMCS every time I create an invoice for a new user it adds some other service there randomly. Same as when someone orders through my website if they order for example service (1) on checkout it will add another service on top of it for no reason and that service doesn't even exist anymore. Also invoices are not being generated. Although no errors when running the cron job. I have Version: 8.4.0 Any help please? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted February 14, 2022 Share Posted February 14, 2022 (edited) You forgot to truncate tblinvoiceitems where invoice items are stored so now every time you create an invoice you endup randomly matching tblinvoice.id with tblinvoiceitems.invoiceid. That's why you see old stuff appearing on new invoices. Solution? Delete all records in tblinvoiceitems where tblinvoiceitems.invoiceid is greater than your maximum tblinvoice.id. Let's say your last invoice ID is 1000. You'll need to... DELETE FROM tblinvoiceitems WHERE invoiceid > '1000' p.s. backup, backup, backup! Edited February 14, 2022 by Kian 0 Quote Link to comment Share on other sites More sharing options...
KNK Posted February 14, 2022 Author Share Posted February 14, 2022 4 hours ago, Kian said: You forgot to truncate tblinvoiceitems where invoice items are stored so now every time you create an invoice you endup randomly matching tblinvoice.id with tblinvoiceitems.invoiceid. That's why you see old stuff appearing on new invoices. Solution? Delete all records in tblinvoiceitems where tblinvoiceitems.invoiceid is greater than your maximum tblinvoice.id. Let's say your last invoice ID is 1000. You'll need to... DELETE FROM tblinvoiceitems WHERE invoiceid > '1000' p.s. backup, backup, backup! Thank you! Although it's not generating new invoices now. It's set to generate to generate 7 days before due date. I forced it with the cron job -all -vvv and nothing happens what could be the reason? 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 14, 2022 Share Posted February 14, 2022 If an invoice has already been generated for a product on a specific date, you will need to change the due date. WHMCS doesn't generate a new invoice unless you change the due date. 1 Quote Link to comment Share on other sites More sharing options...
KNK Posted February 14, 2022 Author Share Posted February 14, 2022 1 hour ago, DennisHermannsen said: If an invoice has already been generated for a product on a specific date, you will need to change the due date. WHMCS doesn't generate a new invoice unless you change the due date. So I just add +1 day on the services that invoice weren't generated? 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 14, 2022 Share Posted February 14, 2022 Yes, or deduct a day. Or you can update the value of nextinvoicedate for the service in the tblhosting table. 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.