Document Naming Series not reset on new Year (Naming Series CHQ-.#####./.YY.)

Hi there,

I am facing an issue in ERPNext. In my custom app I have a Doctype called ‘Cheque’ and some other doctypes with similar naming series. Because I place the YY field at the end of the Naming Series, the counter does not reset to Zero, forcing me to put the YY before the ####, which is unlike what my customers want. How can I overcome this issue?

Cheque Naming Series: CHQ-.#####./.YY.

Other Doctype Naming Series: LA-.#####./.YY. , LES-.#####./.YY. , SI-.#####./.YY.

Before New Year: CHQ-00763/24
After New Year: CHQ-00764/25

Any suggestions?

Hello @Omar-Abdullah

I think this issue arises because ERPNext uses the YY portion in the naming series format to determine when to reset the counter, but it only works correctly when YY is before the counter (#####). In your case, since YY is at the end, the counter does not reset as expected.

To address this, you can implement a custom solution or any other best approch to achive this
image

Thank you @Manav_Mandli for the suggestion.

I am thinking of using the autoname function provided by ERPNext. I will try to play with it and see the best way to implement it.