The built in mechanism for generating Ticket Numbers is something that should not be altered in any way, since resetting a Number Generator will lead to duplicate Ticket Numbers which is not allowed and will break the system.
So if you want control over your Ticket Numbers in a custom fashion where you can reset them, you need to use an Automation flow that updates, increments, and/or resets Global Program Settings (values stored in the Database), and applies those Settings to your Tickets using a Ticket State and/or a Ticket Tag.
This Tutorial shows how control 2 separate Invoice Numbers for different Ticket Types. It can be adapted to control more than 2 Ticket Types, or 1 single Ticket Type. It demonstrates setting both a Ticket State and a Ticket Tag for flexibility, but you can choose one or the other for your implementation.
Suppose we have 2 Ticket Types, and they should have their own numbering system that is controlled separately …
- Ticket
- Ticket2
For each of the Ticket Types, we will control their Numbers separately and individually. Our format for the Invoice Numbers will be similar, in that we have a leading 4-digit “Serial” number following by a 6-digit “Document” number…
0000-000000
^^^^ ^^^^^^
serial document
number number
We will increment the Document Number for each new Ticket. When the Document Number reaches a certain threshold (ie. 999999
), it will Reset to 0
and the Serial Number will increase by 1
.
We will have 3 Program Settings for each Ticket Type:
-
INUMserA
(Ticket) Serial Number -
INUMdocA
(Ticket) Document Number -
INUMinvA
(Ticket) Invoice Number (formatted Serial + Document) -
INUMserB
(Ticket2) Serial Number -
INUMdocB
(Ticket2) Document Number -
INUMinvB
(Ticket2) Invoice Number (formatted Serial + Document)
We will also have a separate Ticket State and Ticket Tag for each of the Ticket Types:
-
InvA
(Ticket Invoice Number) -
InvB
(Ticket2 Invoice Number)