Use variable $token to print sequence/token number after generating the receipt.
<text align="center" length="48" bold="true">Token $token</text>
$token can be used in receipt or KOT. It will work only after generating the receipt.
Use this script when you need to print a sequence number for each receipt/kot generated from different counter/PDA
Maintenance > Resources
For sequence number on receipt:
1. Enable ticket.close event in Ticket.Buttons resource
2. Create a new resource event.close and copy paste the below code
Integer i=0; if(ticket.getGlobalValue()!=null) { i = ticket.parseInt(ticket.getGlobalValue()); } i = i+1; ticket.setGlobalValue(i.toString());
3. Copy-paste the below code inside Printer.Ticket to print the sequence number
<line><text>$ticket.getGlobalValue()</text></line>
4. Restart the software for this script to take effect
For sequence number on KOT:
1. Copy paste the below code in the beginning of resource Script.SendOrder
if(ticket.getProperty("Sequence")==null) { Integer i=0; if(ticket.getGlobalValue()!=null) { i = ticket.parseInt(ticket.getGlobalValue()); } i = i+1; ticket.setGlobalValue(i.toString()); ticket.setProperty("Sequence",i.toString()); }
2. Copy-paste the below code inside Printer.KOT1 to print the sequence number in KOT
<line><text>$ticket.getProperty("Sequence")</text></line>
3. Restart the software for this script to take effect
Leave a Reply