How to format Invoice Numbers incremented automatically?

Need help to auto number invoices, proposals and other documents. General convention followed in India is to identify these documents using financial year. Like FA2324-0001 is the Invoice done on Financial Year 2324 with number 1.

Please see the above graphic. I am unable to automatically set current year plus one so as to make a financial year format.

Can you please help how to do this or point me to the code where I can do changes.

thanks
yesbee

have you tried wrapping the digit and + in curly braces{}?
FA{yy}{yy+1}-{0000}

Skeptical, but give it a try

Ok. This shows logical thinkers think in similar pattern. But it didnt work in Dolibarr. :frowning:

We use this to automatically reset the numbering.
{yy} is here exchanged with the year from the systemdate.

grafik

Each January the counter is reseted.
grafik

Hope this helps…

Hi,

Thanks a ton for the reply. However, I was trying to achieve standard invoice numbering practice in India. Like IN2324-0001 (where 23 is current year achieved by {yy}) But I could not achieve {yy+1} as 24.

@eldy , @ksar any help please.

thanks and regards,
yesbee

Ηι @RiseValInfotech
If at years end last generated invoice is IN2324-0101 then for next fiscal year would be IN2425-0001 or IN2425-0102?

If you start every year with IN2324-0001 then use the mask as i wrote above and from 01.01.2024 your invoices start automatically with IN2424-0001.
Mask = IN{yy}24-{0000@0}

However, if you want your counter to be consecutive over the years, then unfortunately I can’t help you.

Hello :slight_smile:

in version 18.0.3, you can obtain this result with this change in htdocs/core/lib/functions2.lib.php…

Good continuation

1 Like