It looks like that putting twice the [ … [ … ] …] give me problem.
[LAYOUT]
{ORDERS}
[ORDERS]
VL00VNIU|{QUANTITY}|CODE|-|{NAME}|{PRICE}|0|9997|0|EXO|VAT|E|20|0.0|-|0.00|||||0|{PRICE}|{TOTAL PRICE}|0|-|0|0|0|0|0|0|0
{ORDER TAGS}
[ORDER TAGS]
-- Format for order tags
[='{ORDER TAG PRICE}' != 0 ? 'NIU|{QUANTITY}|CODE|-|{ORDER TAG NAME}|{ORDER TAG PRICE}|0|9997|0|EXO|VAT|E|20|0.0|-|0.00|||||0|{ORDER TAG PRICE}|[=F(TN('{QUANTITY}') * TN('{ORDER TAG PRICE}'))]|0|-|0|0|0|0|0|0|0' : '']
IIs nothing being displayed when an order is added without an order tag?
This will be because adding square brackets around a line in the ticket template stops that line showing on the print out if it’s value is zero
So looking at your calculation:
[=F(TN(’{QUANTITY}’) * TN(’{ORDER TAG PRICE}’))]
If there is no order tag then there’s is no order tag price so that value becomes zero, so when quantity is multiplied by zero the result is zero. So the square brackets then act to hide that line from the ticket print out as
On your template is the line that has the square brackets at the start and end coloured in black? If so this is the reason it doesn’t show as those square brackets serve to only show a value on the ticket printout if the value is greater than zero
Might be useful to show that part of your ticket template
[LAYOUT]
<L00>A function, OK
<L00> AAA|[=F(100 + 100)]|BBB
<L00>
<L00>A function in a IF function, OK
[= 0 == 0 ? '<L00> AAA|[=F(100 + 100)]|BBB' : '']
<L00>
<L00>A variable in IF function, OK
[= 0 == 0 ? '<L00> AAA|{CALCULATION TOTAL:Discount}|BBB' : '']
<L00>
<L00>A function with the same variable in IF function: NOT OK.
[= 0 == 0 ? '<L00>AAA|[=F(-1 * TN('{CALCULATION TOTAL:Discount}'))]|BBB' : '']
<L00>
<L00>Nothing displayed, however the function is correct, it returns 0.99:
<L00> function returns: [=F(-1 * TN('{CALCULATION TOTAL:Discount}'))]
Result:
You can see that in 2. there are brackets [=F(100 + 100)] and it works
In 4. brackets (function) + variable and it returns nothing
I got the same problem to print the DETAILED ORDER file (not paper print):
IF ORDER TAG has no price
THEN don't print the TAG line
ELSE print the tag line
which is:
[='{ORDER TAG PRICE}' != 0 ? 'Print the line' : '']
So one (brackets expression)
Now comes my issue.
If I have 2 ORDER TAGS with price and a multiple order (5 mediano), like below:
I need to have the total of each ORDER TAG line and:
I cannot use ORDER TAG PRICE, as it is the price of one ORDER TAG.
I cannot use ORDER TAG TOTAL, as it is the total price of BOTH order tags. (15)
I cannot use {Quantity}X{Order Tag Price}, as it would be nesting expressions like[=x[=x]] which is not possible.
Can I use a script?
If yes, as I don’t have the DB layout, can somebody help me with the SQL to
SELECT [Order Quantity] X [Order Tag Price]) as [Order_Tag_Total_Price_Per_Tag]
WHERE ??? ORDER = the current ORDER and ORDER TAG = the current ORDER TAG
I have no clue on how to pass that information to the script/function in the [ORDER TAGS] section using {Order TAGS}, I don’t know if this is possible neigther
I am not trying to make things difficult, I am live and that scenario happened yesterday and the electronic bill was rejected by the tax administration system because the sum of the lines did not match the total; I was using ORDER TAG TOTAL
So
TAG jkl shows total tag price 15 instead of 10
TAG ghj shows total tag price 15 instead of 5
OK. I added a new tag for next update so you’ll be able to configure order tag line as …
[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME} | [={QUANTITY}>1 && {ORDER TAG PRICE} > 0?'({QUANTITY} x {ORDER TAG PRICE})':''] [{ORDER TAG TOTAL:{ORDER TAG GROUP}={ORDER TAG NAME}}]
This will print order tag total and also a breakdown of the price if order quantity is greater than one. If order quantity is 1 it will print just the price.
I added your account to beta group so you’ll better track the updates. When it is released you’ll see it on the release notes section. Generally we update beta versions multiple times in a week. We release it to public when all new features tested.
so for example in my template a gin and tonic has the tonic as an order tag, as you can see this part is between square brackets, so it only prints on the receipt if an item with an tonic order tag is added to the receipt
[LAYOUT]
-- General layout
<T>FACTURA SIMPLIFICADA
<C00>VENTA PULA
<C00>CIF: 27336502-J
<C00>TELF: 952 11 30 68
<F>*
<L00>Fecha:{TICKET DATE}
<L00>Hora:{TIME}
<F>-
<L00>Factura Simplificada Nº:{TICKET NO}
{ENTITIES}
<F>-
{ORDERS}
<F>=
<EB>
{DISCOUNTS}
[<J10>Total Regalo:|{ORDER STATE TOTAL:Regalo}]
{SERVICES}
<J10>Total(iva incluido):|{TICKET TOTAL}
<F>-
{PAYMENTS}
<DB>
<F>=
<C10>GRACIAS POR SU VISITA
[DISCOUNTS]
<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}
[SERVICES]
<J00>{CALCULATION NAME}|{CALCULATION TOTAL}
[PAYMENTS]
<J00>Pagado:||{TENDERED TOTAL}
<J00>Cambio:|{CHANGE TOTAL}
<XCT>27,112,0,25,250
[ORDERS]
-- Default format for orders
<J00>- {QUANTITY} {NAME}|{TOTAL PRICE}
{ORDER TAGS}
[ENTITIES:Mesa]
-- Table entity format
<L00>Mesa: {ENTITY NAME}
[ENTITIES:Cliente]
-- Customer entity format
<J00>Cliente: {ENTITY NAME}
<L00>CIF:{ENTITY DATA:DNI}
<L00>DIRECCION:
<L00>{ENTITY DATA:Dirección}
[ORDER TAGS]
-- Default format for orders
<J00> * {ORDER TAG NAME} |{ORDER TAG PRICE}
I changed the last line for this one:
<J00> [* {ORDER TAG NAME} | [={QUANTITY}>1 && {ORDER TAG PRICE} > 0?'({QUANTITY} x {ORDER TAG PRICE})':''] [{ORDER TAG TOTAL:{ORDER TAG GROUP}={ORDER TAG NAME}}]]
WOW, I just copied what I said in the previous answers as a solution, and in the end it was as simple as putting square brackets?
It works but I do not understand it.
Thank you very much for your answer, but you can explain it to me.