for each document, it is possible to generate a number using the formula -
https://prnt.sc/otfxr7 and display this number in the document itself using the {documentNumber} variable -
https://prnt.sc/otfy9r , you can specify variables in the document formula
[template.number] - template document number starting from 1 for all time
[template.numberyear] - template document number starting from 1 within the current year
[template.number:3] - template document number starting from 1 for the whole time in the format 0001
[template.numberyear:3] - - template document number starting from 1 within the current year in the format 0001
[template.number:3:100] - template document number starting from 100, when we specify [template.number:3:100] , this means that the number will start from 100, but the maximum length of this number is 3 symbol
if we specify [template.number:6:100] , then the resulting number will be padded with zeros on the left to make a 6-digit number - 000100
I think these variables are more suitable for you