order_invoice_id / order_invoice_number

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
3 years 8 months ago #330708

-- url of the page with the problem -- : www.coloresunidos.com
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.8

Hello,

I need to reset all invoice numbers and start like C21-0001. As the order_invoice_number comes from the order_invoice_id I need to reset the id to 0 so the next invoice number will be 1. I set the settings of "reset invoice id" to daily but the next morning it started from 526 again. The two invoices that are correct I changed them in the database "hikashop_order" table. Is there a solution for this?

**The Hikashop account for my website www.coloresunidos.com has activated again.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 8 months ago #330713

Hi,

At first, reading your message, I thought you meant that the daily reset of the invoice id didn't work.
But looking at your screenshot it seems it worked for 21-0001 and 21-0002
And checking the code on our end for that capability, I don't see any problem with it.
So after thinking about it and rereading your message several times, it seems that you're not saying that this doesn't work, but that if you set it to daily for a day and then you change it again, it continues the increment again were it was left before.
And that's normal based on how the reset system works.
When HikaShop needs to generate the order_invoice_id, it will get the higher order_invoice_id already in the database for the period selected in the reset frequency option. So if you have "daily" selected, it will get the higher order_invoice_id of the current day.
But if you set it to "yearly", it will get the higher_order_invoice_id of the current year.

So if you want to reset the increment regardless of what order_invoice_ids were generated up until now, the best is to set them to 0 for all the orders already created. Since you're using the order_invoice_number for reference and not the order_invoice_id, it should not change anything for your customers or your accounting, but then HikaShop will start again from 0.

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
3 years 8 months ago #330758

Hello,

Is there a way to set the order_invoice_id table to 0 all at once instead of doing it manually?

Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 8 months ago #330786

Hi,

Sure. You can run a mass action via the menu system>Mass actions for that.
The mass action will have to be of the type "order", and you'll just need an action of the type "update the values" on the column "order_invoice_id" and the value 0 with the type being "int".

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

Time to create page: 0.064 seconds
Powered by Kunena Forum