Discount Printer Template Syntax

If I add the calculation {DISCOUNT TOTAL} as below it will work with brackets?

[<J00>TOTAL SAVINGS:|[=F(-1*(TN('{ORDER TAG TOTAL:Discount}')+TN('{ORDER TAG TOTAL:VIP Discount}')+TN('{ORDER TAG TOTAL:HH Discount}')+TN('{DISCOUNT TOTAL}'))+TN('{ORDER STATE TOTAL:Gift}'))]]

You see I am getting this as now I can show total of all discounts; Ticket (DISCOUNT TOTAL), VIP, HH and any Discount Tag. Phew…not sure why it does not print in some cases with “[ ]” as I just copied Q’s syntax out of the V5 tutorial.

Now I need just to alter the format to show Quantity Discount Value when using VIP or HH discount tags as Q’s setup was just for fixed amount whereas I am using percentage (common over here).

PS:@emre if you have your Print Template open and go straight into POS, go back to the template (still open), you can cause the “No Preview”, “No Help” view as I have shown above.

EDIT: Ok further testing it seems unless I have a value in {DISCOUNT TOTAL} nothing will print if I have “[ ]” brackets at the start and end of the line for “TOTAL SAVINGS”? I just duplicated your transaction using “**GIFT” and got a blank line :confused:

FULL TEMPLATE:

[LAYOUT]
-- General layout
<T>Ticket
<L00>Date:{TICKET DATE}
<L00>Time:{TIME}
{ENTITIES}
<L00>Ticket No:{TICKET NO}
<F>-
{ORDERS}
<F>=
<EB>
{DISCOUNTS}
[<J00>Total Gift:|{ORDER STATE TOTAL:Gift}]
[<J00>VIP:|[=F(TN('{ORDER TAG TOTAL:VIP Discount}'),'0.00')]]
[<J00>Happy Hour:|[=F(TN('{ORDER TAG TOTAL:HH Discount}'),'0.00')]]
[<J00>Discount:|[=F(TN('{ORDER TAG TOTAL:Discount}'),'0.00')]]
[<J00>Ticket:|[=F(TN('{DISCOUNT TOTAL}'),'0.00')]]
[<J00>TOTAL SAVINGS:|[=F(-1*(TN('{ORDER TAG TOTAL:Discount}')+TN('{ORDER TAG TOTAL:VIP Discount}')+TN('{ORDER TAG TOTAL:HH Discount}')+TN('{DISCOUNT TOTAL}'))+TN('{ORDER STATE TOTAL:Gift}'))]]

{SERVICES}
<J10>Total:|{TICKET TOTAL}
{PAYMENTS}
<DB>
<F>=
<C10>T H A N K   Y O U

[DISCOUNTS]
<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[SERVICES]
<J00>{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

[ORDERS]
-- Default format for orders
<J00>- {QUANTITY} {NAME}|{TOTAL PRICE}
{ORDER TAGS}

[ORDERS:Gift]
-- Format for gifted orders
<J00>- {QUANTITY} {NAME}|**GIFT**
{ORDER TAGS}

[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[ENTITIES:Customer]
-- Customer entity format
<J00>Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

RESULT:

(Time 11:45pm - oh Dear)

Hmm. Seems like we never implemented bracketing support for expressions. I don’t know how I’ve assumed it works…

It should work fine with expressions on next update. (5.1.54)

Just dont forget the popup that comes up with lol JTR you might want to take that out! :stuck_out_tongue:

haha his nicknamed carved into stone. Nothing can change this anymore :slight_smile:

Hey @emre - should you also include this in your release notes for 5.1.54 as I did not spot it?

Yes, he did. Have you tried it?

Thanks @sukasem - I am obviously reading way too fast or loosing it! :dizzy_face: I even read the notes a 3rd time and still missed that… Yes it did work using the “Total Saving:” syntax in my original template.