- Posts: 224
- Thank you received: 8
How to change the next invoice number?
3 years 10 months ago #346605
by oloccina
How to change the next invoice number? was created by oloccina
Hello,
is there an easy way to change the next invoice number via the dashboard?
I cannot find any option.
If this needs to be done in the database, can you provide some guidance?
Thanks
is there an easy way to change the next invoice number via the dashboard?
I cannot find any option.
If this needs to be done in the database, can you provide some guidance?
Thanks
Please Log in or Create an account to join the conversation.
3 years 10 months ago #346613
by nicolas
Replied by nicolas on topic How to change the next invoice number?
Hi,
It depends. The invoice number is generated based on the "invoice number format" setting in the HikaShop configuration. So to be able to say how to change the next invoice number, we would first need to need what format you're using for it.
Could you provide that information ?
It depends. The invoice number is generated based on the "invoice number format" setting in the HikaShop configuration. So to be able to say how to change the next invoice number, we would first need to need what format you're using for it.
Could you provide that information ?
Please Log in or Create an account to join the conversation.
3 years 10 months ago #346626
by oloccina
Replied by oloccina on topic How to change the next invoice number?
I am using
{id} - {date format="Y"}
{id} - {date format="Y"}
Please Log in or Create an account to join the conversation.
3 years 10 months ago #346634
by nicolas
Replied by nicolas on topic How to change the next invoice number?
So, if you use {id} it will be replaced by the max order_invoice_id + 1.
If you want the next order's number to be bigger than the current one, you can create an order and change its order_invoice_id to be one lower. For example, if you want the next order's number to start with 2000, you want to set 1999 in the order_invoice_id of your order via PHPMyAdmin.
If you want the next order's number to be lower than the current one, then it's a bit more difficult. You would need to change the order_invoice_id of all the existing orders to be lower than the order_invoice_id you want. It's possible with a MySQL query (or a mass action with an "update the values" action on the order_invoice_id column).
If you want the next order's number to be bigger than the current one, you can create an order and change its order_invoice_id to be one lower. For example, if you want the next order's number to start with 2000, you want to set 1999 in the order_invoice_id of your order via PHPMyAdmin.
If you want the next order's number to be lower than the current one, then it's a bit more difficult. You would need to change the order_invoice_id of all the existing orders to be lower than the order_invoice_id you want. It's possible with a MySQL query (or a mass action with an "update the values" action on the order_invoice_id column).
Please Log in or Create an account to join the conversation.
3 years 10 months ago - 3 years 10 months ago #346642
by oloccina
Replied by oloccina on topic How to change the next invoice number?
Thanks.
See here tinyurl.com/2pjyz5ke
My last order_invoice_id is 14
So the next invoice number should be 15, right?
This would be correct
I asked because I generated a new order plus an invoice with number 15 to make a test, and then deleted it.
But I was worried the system would now generate starting from number 16.
Looking at the database though, I guess if I delete a confirmed order the next order will take it's place in term of invoice numbering?
See here tinyurl.com/2pjyz5ke
My last order_invoice_id is 14
So the next invoice number should be 15, right?
This would be correct
I asked because I generated a new order plus an invoice with number 15 to make a test, and then deleted it.
But I was worried the system would now generate starting from number 16.
Looking at the database though, I guess if I delete a confirmed order the next order will take it's place in term of invoice numbering?
Last edit: 3 years 10 months ago by oloccina.
Please Log in or Create an account to join the conversation.
3 years 10 months ago #346643
by nicolas
Replied by nicolas on topic How to change the next invoice number?
Hi,
Yes.
If the order was deleted, then yes, the next one will have the same order_invoice_id.
Only the order_id will keep incrementing even if you delete the last order.
Yes.
If the order was deleted, then yes, the next one will have the same order_invoice_id.
Only the order_id will keep incrementing even if you delete the last order.
Please Log in or Create an account to join the conversation.
Time to create page: 0.200 seconds