Print subtotal although equal to the total

hi,
I would like to print the subtotal although equal to the total.
I found a few posts but I could not.
Work on v4
thank you

why subtotal if its equal to total?
sorry not quite following , are you having problems?

{PLAIN TOTAL} is described as subtotal if thats what your asking?

on other posts I read that if the subtotal is equal to the total is not printed.
I will that is always printed, even if the ticket has no discounts etc …

Its actually the opposite @markjw . The PLAIN TOTAL tag works when its different than the Total so it prevents duplicate lines. To always display it you actually want it in Brackets.

Funny because @spanky you messaged me with a link that explained that already.

@Jesse yeah I just realised, wasn’t thinking properly :stuck_out_tongue:

The brackets will stop it displaying if the value is empty, but {PLAIN TOTAL} won’t be populated unless it is different from {TICKET TOTAL}.

I deleted my previous post since it was misleading.

I tried it with parentheses but does not print

How about [='{PLAIN TOTAL}'==''?'{TICKET TOTAL}':'{PLAIN TOTAL}']

<J00>Subtotal: | £[='{PLAIN TOTAL}'==''?'{TICKET TOTAL}':'{PLAIN TOTAL}']

I tried that too but nothing, blank line

Try like this;

<J00>Subtotal: | £[=TN('{PLAIN TOTAL}')==0?'{TICKET TOTAL}':'{PLAIN TOTAL}']

nothing, empty field

and if you would sum up the total ticket with discount or rounding?

To be honest im not quite following what your issue is…
Can you show me a printed ticket with the problem so I can understand what your problem is?

I want to print the subtotal when is when there are discounts or arrotonamente, both when we are not.
I tried to add up that way, but something does not, the rounding is subtracted

[=F(TN(’{TICKET TOTAL}’) + (0-TN(’{DISCOUNT TOTAL}’) + 0-TN(’{CALCULATION TOTAL}’)))]

Think your brackets are out of whack, think that should look more like this;

[=F(TN('{TICKET TOTAL}') + (0-TN('{DISCOUNT TOTAL}')) + (0-TN('{CALCULATION TOTAL}')))]

Am only looking at the formula not what the tags are, cant remember is calculation come back as positive or negative in relation to discount/round up/down etc just going on that you used 0-…

Show your template. Please.

I think the ? choice syntax only works in V5 ?

Working with v4.
I tried both:
[=F(TN('{TICKET TOTAL}') + (0-TN('{DISCOUNT TOTAL}')) + (0-TN('{CALCULATION TOTAL}')))]

that:
<J00>Subtotal: | £[=TN('{PLAIN TOTAL}')==0?'{TICKET TOTAL}':'{PLAIN TOTAL}']

my model is:

[LAYOUT]
<L00>1020;1
<J00>[=F(TN('{TICKET TOTAL}') + (0-TN('{DISCOUNT TOTAL}')) + (0-TN('{CALCULATION TOTAL}')))]
{DISCOUNTS}
{SERVICES}
<L00>1030;1;1;;
[DISCOUNTS]
<J00>1025;2;1;SCONTO %{CALCULATION AMOUNT};[=F(0-TN('{DISCOUNT TOTAL}'),'0.##')]
[SERVICES]
<J00>1025;2;1;Arrotonda {CALCULATION AMOUNT} euro;[=F(0-TN('{CALCULATION TOTAL}'),'0.##')]
[PAYMENTS]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

I have to print a receipt printer with an internal protocol

to me just print the total of ticket including taxes, discount, rounding

@spanky Surely that’s not your entire template? Anyway did you try this? Notice I put entire line in brackets not just whats after <J00>

[LAYOUT]
<L00>1020;1
[<J00>{PLAIN TOTAL}]
{DISCOUNTS}
{SERVICES}
<L00>1030;1;1;;
[DISCOUNTS]
<J00>1025;2;1;SCONTO %{CALCULATION AMOUNT};[=F(0-TN('{DISCOUNT TOTAL}'),'0.##')]
[SERVICES]
<J00>1025;2;1;Arrotonda {CALCULATION AMOUNT} euro;[=F(0-TN('{CALCULATION TOTAL}'),'0.##')]
[PAYMENTS]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

Correct ternary is only available in v5 so something like this below would never work in v4:

<J00>Subtotal: | £[=TN('{PLAIN TOTAL}')==0?'{TICKET TOTAL}':'{PLAIN TOTAL}']