How to change the next invoice number?

  • Posts: 224
  • Thank you received: 8
2 years 1 week ago #346605

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

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 week ago #346613

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 ?

Please Log in or Create an account to join the conversation.

  • Posts: 224
  • Thank you received: 8
2 years 6 days ago #346626

I am using
{id} - {date format="Y"}

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 days ago #346634

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).

Please Log in or Create an account to join the conversation.

  • Posts: 224
  • Thank you received: 8
2 years 6 days ago #346642

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?

Last edit: 2 years 6 days ago by oloccina.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 days ago #346643

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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.041 seconds
Powered by Kunena Forum