are there any way to reset the invoice number with the change of year?
Just like this:
Invoice Number Invoice Date
0123 12-15-2015
0124 12-18-2015
0125 12-22-2015</code>
<strong><code>0001 01-04-2016</code></strong>
I think that the principal problem will come with the "invoices_account_id_invoice_number_unique" index. And may be, the best way to solve is adding the "invoice_date" field to this index
Yes, I thought about doing it that way, but does not work well. When I set the counter to 1, the system searches the last counter for the account and puts that plus one.
I think the search for the last counter should be for the account per year, but need to see how and where to do it.
Are you using a prefix or a pattern. From reviewing the code I believe if you use a pattern the system won’t automatically increment the counter. For example: {$year}-{$counter}