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.
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.
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.
To have add dash, hypen or minus signs between current and next year. I used the following code in htdocs/core/lib/functions2.lib.php
// We replace special codes except refclient
if (!empty($yearoffsettype) && !is_numeric($yearoffsettype) && $yearoffsettype != '=') { // yearoffsettype is - or +, so we don't want current year
$numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date) + $yearoffset, $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y", $date) + $yearoffset, $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1) + $yearoffset, $numFinal);
} else { // we want yyyy to be current year
$numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date), $numFinal);
//$numFinal = preg_replace('/\{yy\}/i', date("y", $date), $numFinal); // disable default {yy} to be current year
$numFinal = preg_replace('/\{yy\}/i', date("y", $date). '-' .(intval(date("y", $date)) + 1), $numFinal); // Modified Date to be 24-25 if using {yy}
$numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1), $numFinal);
}
But this doesn’t get reflected throughout the system, like on invoice no. while on invoice card or generatting PDF file