View Categories

Dynamic printer or print format selection

< 1 min read

Dynamic printer or print format selection for receipts, KOTs etc., based on certain conditions

Maintenance > Resources
Following example determine printer based on table name. Here orders from tables with name starting with DI goes to printer 1, table names starting with GA goes to printer 2 and orders from all other tables goes to printer 3. This checking can be used in Printer.Ticket, Printer.KOT, etc., on the element <ticket>

<output>
    ...
    ...
    ...
#if($place.startsWith("DI"))
    <ticket printer = "1">
#elseif($place.startsWith("GA"))
    <ticket printer = "2">
#else
    <ticket printer = "3">
#end
    ...
    ...
    ...
</ticket>
</output>

If one wants to dynamically choose the receipt format, do like below;

<output>
    ...
    ...
    ...
#if($place.startsWith("DI"))
    <ticket printer = "1">
    ...
    ...
    ...
    </ticket>
#elseif($place.startsWith("GA"))
    <ticket printer = "2">
    ...
    ...
    ...
    </ticket>
#else
    <ticket printer = "3">
    ...
    ...
    ...
    </ticket>
#end
    ...
    ...
    ...
</output>

Save & restart

0 Comments

Leave a Reply

Arrow-up