Mucker Posted July 25, 2012 Share Posted July 25, 2012 I KNOW you shouldn't be deleting invoices but since I am new to WHMCS at the moment I am just playing around with it and testing the features before I go live so...I do want to delete invoices, as well as transactions because these are all fake payments which will affect my finance and stats when I go live. My question is that I was wondering if there is a way to re-generate an invoice that has already been generated but then deleted? I know there are ways around this by changing the product next due date but what if I don't want to do that? I am trying to figure out how WHMCS knows that an invoice was generated for that exact date therefore won't generate it again after I delete it; it obviously stores some hidden data which isn't accessible to the WHMCS admin console. This also brings me to another point; is there a way I can delete all records relating to payments, transactions, invoices, orders etc? Is there a script that maybe the WHMCS staff offer for this kind of thing? I'd imagine this happens quite regularly when someone like me uses WHMCS for the first time you obviously want to test it out first before going live with it. I do not want to start a completely new instance of WHMCS because I will lose all my products, clients and customization, I just want to delete payment related info. 0 Quote Link to comment Share on other sites More sharing options...
Bubka3 Posted July 26, 2012 Share Posted July 26, 2012 I can't explain how it works, but if you set the date back one and then back to the one you want, you can recreate the invoice. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted July 26, 2012 Share Posted July 26, 2012 Did you delete the invoice, or delete the items on the invoice, or just cancel the invoice ? If you simply deleted the invoice - you cant regenerate it If you're just testing, then when you've finished, truncate the invoice, invoiceitems, and accounts tbls 0 Quote Link to comment Share on other sites More sharing options...
Bubka3 Posted July 27, 2012 Share Posted July 27, 2012 If you simply deleted the invoice - you cant regenerate it Wrong! Found the explanation from WHMCS support: WHMCS will never generate a duplicate invoice, even if it's been deleted. So you'll need to move the product's Next Due Date forward or back by 1 day and the renewal invoice will then generate. 0 Quote Link to comment Share on other sites More sharing options...
Mucker Posted July 27, 2012 Author Share Posted July 27, 2012 I thought as much....This is stupid though because that means there is data left over if you were doing tests. What if I want to clean the database (without starting again)? Sounds like it leaves traces of crap behind when you delete stuff. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 27, 2012 Share Posted July 27, 2012 Here is a hack for this that doesn't leave anything behind as far as I can see and you can keep the same due date, but it takes a few steps. -View the invoice and delete the line items of the invoice -Then delete or cancel the invoice -Edit each service and addon that was on the invoice and set the next due date back one day and click save. Then set the invoice date back to the orignal date and click save again. -You will now be able to generate a new invoice. What happens is there is a column in the database called nextinvoicedate that doesn't get set back to the nextduedate when you cancel/delete an invoice. By changing the next due date and then changing it back, WHMCS updates this field again to match the nextduedate which allows for the invoice to be regenerated. You also need to make sure you delete the line items of the invoice or the new invoice will not be generated. 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.