Here is @QMcKay ‘s step by step tutorial on creating a unique ticket number that is applied as a ticket tag ONLY when the ticket is fully paid
So you complete your first transaction and the ticket is paid the ticket number of 1 is created and added as a ticket tag
Open two more tickets, no number is added yet as those tickets are not yet paid. Merge those tickets to one ticket, and settle and fully pay and the ticket number 2 is added as a ticket tag
And so on
So as the ticket number is ONLY applied when the ticket is fully paid all your sale transactions will have a sequential incrementing number
Have a read of the tutorial below