Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_sidebar.php on line 8

Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_menu.php on line 278

VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: Reset the counter every year

Reset the counter every year 02 Sep 2015 19:43 #1

Hi,

what I have to do to create an counter which resets every year? I like to have an numbers like 150902-1, 150902-2, 150904-3, 160101-1.
It should not matter if the order comes from the english store view or another one.

Currently I have the following format:
Format: RE-WS-[year2][month][day]-#
Scope: Use same counter for all countries
Reset counter: One new counter per year

Is that the correct config?

Regards
Stefano
The administrator has disabled public write access.

Reset the counter every year 03 Sep 2015 18:17 #2

Dear Stefano,
Yes, these settings look correct to me. Do you have any issues with these settings?

Best regards,
Reinhold
The administrator has disabled public write access.

Reset the counter every year 07 Sep 2015 18:25 #3

Hey,

first of all I don't understand why there are multiple entries for the same kind like invoice or order as you can see in Screenshot #1. Some are counting up, some stay at 1 and some have no counter name.

Second the counter increases in a non-logical way as you can see in screenshot #2. Every new day the counter resets but starts with a higher number.

Best regards,
Stefano
Attachments:
The administrator has disabled public write access.

Reset the counter every year 13 Sep 2015 22:55 #4

Dear Stefano,
What are your exact settings for the extension? To me it seems like several of the counters were created automatically during a testing phase. To me it appears that you changed the counter setting from "format-specific counter" to "global counter" on Sept 3 or 4. The current counter values are in line with such a config change.

Regarding the counter names:
- Global counters have no name (they are global, so there is no need to distinguish them).
- Format-specific counters have the name of format with all variables replaced by their values.

For more insight on the counter naming, the following section (for the ordernumber plugin for VirtueMart, but that plugin uses the exact same logic as the Magento extension) might give you some more information:
open-tools.net/documentation/ordernumber...at_specific_counters

Regarding your questions:

1) The counters named "RE-WS-150813-#" and "RE-WS-150903-#" seem to come from your tests, before you changed the counter to global. A format-specific counter on Aug. 13 uses "RE-WS-150813-#" as its counter name, and on Sept. 3 it uses "RE-WS-150903-#" as counter name. Clearly, once that day has passed, the counter will never be increased any more.
After you switched to a global counter, the counter that is now actually used is the unnamed counter in the second row (with value 6).

2) If you look at your invoice numbers, starting on Sept 5, the numbers are increasing as expected. So I would guess that there was some config change (from format-specific counter to global counter) between the test orders on Sept 3 and the test orders on Sept 5...

Without knowing the exact configuration, it's hard to give secure advice, which counters are not needed any more and can deleted... About half of the existing counters can be deleted, but without further information I hesitate to give instructions which of the counters are no longer required.

Judging from the test orders on Sept 5 and 7, I would say that the counter properly increases with the current settings, but those old orders are not increasing as expected due to config changes.

Best regards,
Reinhold
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular