Home Forums Support [New Feature?] Reset invoice number with the new year

This topic contains 4 replies, has 2 voices, and was last updated by  ridgarou 3 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2197

    ridgarou
    Participant

    Hello,

    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

    0001 01-04-2016

    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

    #2200

    Hillel Coren
    Keymaster

    You should be able to do this manually by setting the counter back to 1 on /settings/invoice_settings

    We’ll look into adding this as a setting in a future release.

    #2223

    ridgarou
    Participant

    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.

    #2225

    Hillel Coren
    Keymaster

    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}

    #2230

    ridgarou
    Participant

    I have to revise it, but I swear I tried using prefix

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Posted in: