Custom Number Generator

How to make Ticket Numbering special format A201602190001(A=Word, 20160219=DATE and 0001=Number #)

You can use Update Ticket Tag action and set your own number format if you want. Several things can be used including {DATE:X}, {RANDOM:X} and any other valid tag you wish to use.

1 Like

Hi @Jesse, How would you use these? {DATE:X} do i just enter this into the numbering field or do i have to put {DATE: DDMMYYY} same for {Random:X} what is the correct way of using this?

From Printer Template Help:

{RANDOM}    Date based Random Number
{RANDOM:X}  Random Number
{RANDOMC:X} Random Number with check digit

Those ^ descriptions are not quite accurate. The only one that generates a Pure Number is {RANDOM}, while the others actually generate random AlphaNumeric Strings. There is also one other generator which has syntax of {RANDOM:X:<chars>}


##{RANDOM:X} and {RANDOM:X:<chars>}##

Generates random strings.

{RANDOM:6}
Generates a 6-character Alphanumeric string, for example “3dH71d”

{RANDOM:4:0123456789}
Generates a 4-character numeric string using values from “0123456789”, for example “7396”

{RANDOM:5:01234abcdefABCDEF}
Generate a 5-character string using values from “01234abcdefABCDEF”, for example “dB3A2”

You can concatenate them if you want:

{RANDOM:3:abcdefghij} {RANDOM:4:0123456789}
Generate 3-character then 4 numeric with space in-between, for example “eab 8303”

##{DATE:X}

Takes the current Date/Time and formats it according to your specification.

{DATE:yyyy-MM-dd_hh.mm.ss.fff}
Generates: 2016-04-25_09.43.22.645

The formatting characters determine the output. For example:

MM   : 2-digit Month
mm   : 2-digit Minute
MMM  : abbreviated 3-character Month
MMMM : Full Name of the Month.

More Format information can be found here:

https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx


Use Random and Date together …

{RANDOM:3:abcdefghij}-{DATE:yyyyMMdd}-{RANDOM:4:0123456789}
Generate 3-characters, then Date, then 4 numeric with dashes in-between, for example “fad-20150425-3858”


Test using Ask Question Action:

<font Consolas><size 20>RANDOM                 : {RANDOM}\rRANDOMC:5              : {RANDOMC:5}\rRANDOM:5               : {RANDOM:5}\rRANDOM:8:12345abcdEFGH : {RANDOM:8:12345abcdEFGH}\rDATE:yyyyMMdd          : {DATE:yyyyMMdd}</size></font>

4 Likes

Thank you for that @QMcKay

Hi,

Can I insert {RANDOM:6} into the number format below

and get a random number or do i need to do something else as this doesnt seem to be working

Why do you want a random ticket number?

i dont need it for my system but a friend of mine has asked whether i can do it as he wants it on his system as he is looking at getting sambapos

For what purpose would he want a random ticket number?
If it were like a reference or something you would typically add the random number as say a ticket tag and put that tag in your template.
If you really wanted you could write the ticket tag {} over the ticket number {}

No, you cannot do that. And there is no need to.

You can use a Ticket Tag to store random numbers with the Ticket.

im not sure exactly. I know his existing epos system has a random number. I think he wants it to be the same as what he has

I would say you could replicate it but I wouldn’t do it by trying to make ticket number random.
Either way a number generator would be for the purpose of having sequential numbers anyway.

1 Like

ok so the best way would be to create a ticket tag and have that store the number on the ticket. Thats fine, I’ll get him to do that

It depends what the intended use would be… not got much info to advise but if its just to have a long complex looking number as a ‘reference’ on the ticket that would do the job.

I think thats what its for, rather than just having order number 123 etc. His cuurent system has something like 15/ZRP/10584/1512 or something similar

I doubt its random, there will be a pattern.

Some Retail POS use random unique numbers.

@QMcKay its a request we are organizing a event , and I have event ticket template so I can print them in thermal printer , as I am using random tag for bar code . That’s ok but I want to track those number if want to took a raffle draw so is there any chance can print serial numbers in bar code like 001 , as I can create entity type but this is not fully restaurant event we just supply food so not 100 percent sales are us, there is no mean of saving entities pls guide me how can I store those numbers which is easy like 1-100 Thank you