PDA

View Full Version : Changing Invoice Numbers



xuser
12-21-07, 07:18 AM
Due to some internal reasons, I need to change the invoice numbers that are already being created. Could you please let me know how to re-arrange the invoice numbers?

Or is it possible to re-generate all the invoice numbers?

Thanks for your help.

nitro
12-21-07, 08:33 AM
In our installation (WHMCS 3.5.1) I can change the invoice number in the "Options" tab of the invoice from the admin area. I already had to do this on one invoice that we had imported from our previous billing system and had no issues. Just make sure that your templates are updated to use the invoice number field rather than invoice ID as was the case in 3.4.x

The invoice number is stored in the database in a separate field "invoicenum" so you should be able to bulk update those via SQL commands if required without having to resort to doing everything thorough the admin screens.

xuser
12-21-07, 09:10 AM
Thanks for your reply Nitro.


Configuration > Invoices >

Invoice Starting #

You should only enter this if you want to change the invoice starting number
The number you enter here must be greater than the last generated invoice # which is 5050

If I change the invoice number here (let's say 6000), will all the invoices number be re-generated for all the orders according to the date?

nitro
12-21-07, 10:17 AM
existing invoice will not be regenerated / changed, you will need to change those numbers manually in the way I mentioned earlier. then you set a new starting number in the location you mention and WHMCS will use this for any new invoices

you could do easily enough if you just want to add 6000 to invoice numbers use SQL something like:

UPDATE tblinvoices SET invoicenum = id + 6000 WHERE invoicenum = '';

You will need to understand this SQL and make sure it is doing what you want before you run it, also don't forget to ake a backup first - no responsibility taken here if you trash your DB.