Ah, thanks for the screenshot. I can now see what the "problem" is: You are using the order number in the invoice number format. Since each order will have a different order number, the invoice number format will be different for each invoice and thus the counter will start from 1.
To make this clearer, let's look at an example. Suppose you have orders with order numbers "Order-01", "Order-02", etc. and the invoice number format "[year]/[orderNumber]/#".
First order:
- The plugin will replace all [...] variables in the format with the current values. This results in a format string "2014/Order-01/#".
- The plugin will check the database whether a counter for "2014/Order-01/#" already exists.
- Since there is no counter in the database yet, the plugin will use a counter value of 1
- The plugin will insert the counter value in the format string, resulting in "2014/Order-01/1"
- The plugin will write the counter value 1 for the format "2014/Order-01/#" to the database
Second order:
Will be exactly the same, since the order number is "Order-02", the plugin will look for a counter named "2014/Order-02/#". As this does not exist yet, it will use a counter value of 1.
You might want to use a global invoice number counter (rather than "Separate counter per format value"). This will cause the plugin to always look up the counter named "#" from the database in the second and fifth step above.
Best regards,
Reinhold