Assign Bill number to Sales Invoice

Hi guys i have a question
I created doctype that has information about my sales invoice in this doctype i have range of bill number ,like 1 to 100 , i wanna assign to sales invoice unique number from the Invoice doctype for example

Invoice Doctyoe i have range of 1 to 100
in every new sales invoice i wanna assign unique and ordered number from 1 to 100 to my invoices

im confused how to do it , someone has any idea ?

appreciate your help
Best regards

you can do it in the validation method for that specific doctype in .py. Please refer in the code of erpnext there are may good sample there

thanks a lot @ccfiel can you tell me for example which doctype is good to review , im otally lost if you can guide me which part i can make changes will be great :smiley: