HI,
I think I posted Sales Invoice No.S2-402318 a while ago.
Document numbers are assigned in the order in which the posting was performed, not in the order of posting date.
For example:
First, you posted Sales Invoice A with the posting date "7/12/2021" one week ago. Then, you posted Sales Invoice B with the posting date "6/12/2021" yesterday.
Then the document number of Posted Sales Invoice A will be smaller than the document number of Posted Sales Invoice B.
I'm happy to be of help.
S.Kawamura