Invoice number reset (new year)

  • Posts: 49
  • Thank you received: 2
5 years 11 months ago #301694

-- url of the page with the problem -- : www.cornelia-lachnitt.de
-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.2

Hi there,

I want the invoice numbers (not the order numbers) to be reset on the 1st of January next year.
The configuration is as follows:



Is there anything else I have to configure?

Many thanks in advance
Torsten

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
5 years 11 months ago #301699

Hi,

This won't work. In the "invoice number format", you have the "order_id" tag instead of "id" or "order_invoice_id". What the "invoice numver reset frequency" resets is actually the order_invoice_id, the order_id is never reset.
So you would have to change the format to use id or order_invoice_id.
Note however that when you do, your new orders' invoice number will probably not match with the previous ones. To avoid that, you would have to modify the order_invoice_id of the last order in the hikashop_order table via your phpmyadmin and set it to the order_id value of that last order. That way, for the next order, it will automatically use the the same id/number as it would have if basing itself on the order_id.

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

  • Posts: 49
  • Thank you received: 2
5 years 11 months ago #301748

Hi Nicolas,

many thanks for the update and for your hints.

I did some testing on my local test server, if I use the "id"



the invoice number format is correct:


So can I take these settings and do I still have to change the "hikashop_order table"?

Many thanks in advance
Torsten

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
5 years 11 months ago #301749

Hi,

The change I was talking in the hikashop_order is only if you have a discrepency in the numbering (the format itself won't be a problem), but it might not be the case, or you might not care about it.
So if the result is ok for you like that, then no need to change the database.

The following user(s) said Thank You: CorneliaML

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

  • Posts: 49
  • Thank you received: 2
5 years 11 months ago #301844

Thanks again for your help, Nicolas :)
I will get back to you if I encounter any problems or errors.
Best regards
Torsten

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

  • Posts: 49
  • Thank you received: 2
5 years 9 months ago #303068

Hi Nicolas,

somehow, the changes to the live site got lost and after our holiday, the first invoice number has the wrong format.

The first invoice of the year should start with "00012019", now we´ve got "01632019" as the last invoice in 2018 was "01622018".
How can I fix this?

Many thanks in advance
Torsten

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
5 years 9 months ago #303085

Hi,

If you want to change the invoice ids and numbers, you can either open the hikashop_order table via your phpmyadmin and change the values of each order manually, or you can do that with a "display the results" action on the order data and select the columns you want to see/change via the menu System>Mass actions.
Once you finish the changes, make sure that you configured the "Invoice number reset frequency" setting to "every year", otherwise, it will continue with 01632019 instead of picking up the new numbering of 2019.

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

  • Posts: 49
  • Thank you received: 2
5 years 9 months ago #303147

Hi Nicolas,

many thanks for your hints, helpful as always :)
I´ve change the configuration to the following (and also made sure that it was saved ;) )



So I guess I will try the "mass action"-method, this is the configuration:


If I click on process and edit the list, it will be saved to the database? And if I change the wrong "01632019" to "00012019", the next invoice number will be "00022019"?

Many thanks in advance
Torsten

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
5 years 9 months ago #303154

Hi,

Yes, it's exactly that. If you change cells in the results table and validate it will update the database, as if you were doing it from phpmyadmin.
Note that it's not only 01632019 that you need to change. You need to change all the invoice ids and numbers created since the beginning of the year. Only after that will it be able to pick up from there. That's because the system works like that:
When an order is confirmed, it will load the highest invoice id amongst all the orders created since the beginning of the year and increment that value to set it as the invoice id of that newly confirmed order.

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

  • Posts: 49
  • Thank you received: 2
5 years 9 months ago #303190

Thanks Nicolas for the clarification :)
What about the cancelled orders? If I do the "mass action" method there, I only get a table with zeros:



That´s weird because we had 3 cancelled orders this month

Best regards
Torsten

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
5 years 9 months ago #303215

Hi,

If you get zeros, it means that these orders were never confirmed and went straight from created to cancelled. Thus, no invoice number was generated for them so you can ignore them.

The following user(s) said Thank You: CorneliaML

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

  • Posts: 49
  • Thank you received: 2
5 years 9 months ago #303258

Thank you Nicolas :)
Best regards
Torsten

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

Time to create page: 0.077 seconds
Powered by Kunena Forum