Ticket printing variables or functions

Hello áll, i would like ask that is there chnace to use variables in printing templates?

Im would like to use and expression within an if but i cannot .

I will try to imsert the code asap here.

UPDATE:

This is what i need:

[=('{ORDER TAG QUANTITY}' > 1 ? ' {QUANTITY} * {ORDER TAG QUANTITY} * {ORDER TAG PRICE}FT | (={QUANTITY}{ORDER TAG QUANTITY}{ORDER TAG PRICE})FT':'')]

i need to multiple these tag values: (={QUANTITY}{ORDER TAG QUANTITY}{ORDER TAG PRICE}) within a Ternary expression.

[LAYOUT]
 -- General layout
<div style="text-align:center;"><img src="C:\Users\bugly\Documents\SambaPOS5\hullamv6.bmp"></div>
<J00>
<C00>Deb-Profood Kft.
<C00>4028 DEBRECEN
<C00>SZIGLIGETI UTCA 18. 2/7
<C00>HULLÁM ÉTELBÁR
<C00>8174 BALATONKENESE
<C00>Vak Bottyán strandfürdő 6.
<C00>25031050-2-09
<J00>
<C00>RENDELÉSI NYUGTA
<L00>
<L00>  Dátum: {TICKET DATE}
<L00>  Idő: {TIME}
{ENTITIES}
<F>=
<J00>
<div style="font-weight:bold;font-size:18px;text-align:center;">Az ön hívószáma: {TICKET TAG:ORDER NO}</div>
<J00>
<F>=
{ORDERS}
<F>=
<EB>
<L00>
{DISCOUNTS}
{TAXES}
//<J00>Részösszeg:|[=F(TN('{TICKET TOTAL}')-TN('{TAX TOTAL}'))] Ft
<J00>Végösszeg:|{TICKET TOTAL} FT
<J00>Áfa 27%:|{TAX TOTAL} FT
<L00>
<F>-
{PAYMENTS}
<F>-
<DB>
<L00>
<F>*
<C00>Nem adóügyi bizonylat!
<F>*
<C00>Köszönjük hogy vendégünk volt!
<F>*
[DISCOUNTS]
<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}
 
[PAYMENTS]

<C00>Fizetési mód: {PAYMENT NAME}
 
[ORDERS]
-- Default format for orders
[=('{QUANTITY}' == 1 ? '<J00>{NAME}|{PRICE}FT':'')]
[=('{QUANTITY}'>1 ? '<L00>{NAME}':'' )]
[=('{QUANTITY}'>1 ? ('{ITEM TAG:egesz}'=='igen' ? '<J00> {QUANTITY}dkg  *  {PRICE}FT|{TOTAL AMOUNT}FT':'<J00> {QUANTITY}DB  *  {PRICE}FT|{TOTAL AMOUNT}FT'):'' )]

{ORDER TAGS}
 
[ORDERS:ENT]
-- Format for ENT orders
<J00> - {QUANTITY} {NAME}|**ENT**
{ORDER TAGS}
 
[ORDERS:Void]
-- Nothing will print for void lines
 
[ORDER TAGS]
-- Format for order tags
[=('{ORDER TAG PRICE}'< '1' ? '<J00> {ORDER TAG NAME}' : ('{ORDER TAG QUANTITY}' > 1 ? '<J00> {ORDER TAG NAME} X {ORDER TAG QUANTITY}' : ('{QUANTITY}' == 1 ? '<J00>  {ORDER TAG NAME}|{ORDER TAG PRICE}FT' : '<J00> {ORDER TAG NAME}')))]
[=('{ORDER TAG QUANTITY}' > 1 ? '<J00>  {QUANTITY} * {ORDER TAG QUANTITY} * {ORDER TAG PRICE}FT | (={QUANTITY}*{ORDER TAG QUANTITY}*{ORDER TAG PRICE})FT':'')]
[=('{QUANTITY}' > 1 ? ('{ORDER TAG QUANTITY}' > 1 ? '' : '<J00>  {QUANTITY}DB * {ORDER TAG PRICE}FT|{ORDER TAG TOTAL}FT') : '')]
//<J00>{ORDER TAG TOTAL PRICE}`

This is what i need:

[=('{ORDER TAG QUANTITY}' > 1 ? '<J00>  {QUANTITY} * {ORDER TAG QUANTITY} * {ORDER TAG PRICE}FT | (={QUANTITY}*{ORDER TAG QUANTITY}*{ORDER TAG PRICE})FT':'')]

i need to times these tag values: (={QUANTITY}*{ORDER TAG QUANTITY}*{ORDER TAG PRICE}) within a Ternary expression.

[=F(TN('{QUANTITY}') * TN('{ORDER TAG QUANTITY}') * TN('{ORDER TAG PRICE}'))]

F is like formula/Function
TN is Turn to numerical Number

1 Like

Well my problem is that it is in a ternary expression .

And a cannot run nothing within. What you suggested is noit wortking :confused:

Are you sure?
Just because it isnt working doesnt mean its that value in ternary expression, could be incorect in some way.

Have you tested the calculation outside the expression?

Also sugest you use a TN(’’) arround the tag your using to do a <> against.

Tried outside . it is working but didnt working inside. :confused: unhappy for us i cannot get the order tag price if it more than 2:/

Why do you even need the ternary expression, its a multiplication so if its 1 or 2 or 100 the maths still works.

Did you try adding TN(’’) arround the first part?
Plus thats WRONG anyway

it should be

[= TN(’{ORDER TAG QUANTITY}’) > 1 ?

You only use quotes for stings, not numbers.

1 Like

But it is working without the multiplication.

I need couse if only 1 order tag is i dönt need to print.

OK, but did you read this, the ternary expression looks wrong to me;

Those things ^ are not valid inside an expression and have no meaning within an expression.

Try something like this:

[<J00>[=TN('{ORDER TAG QUANTITY}') > 1 ? (TN('{QUANTITY}') * TN('{ORDER TAG QUANTITY}') * TN('{ORDER TAG PRICE}')) FT : ''] | [=(TN('{QUANTITY}') * TN('{ORDER TAG QUANTITY}') * TN('{ORDER TAG PRICE}')) FT : '']]
1 Like

Sorry for the late replay.
Doesnt working at all :confused:

Show what you have done.

i will go to have some food right now i will comeback asap 40min, than i can post printscreens and codesnipests.

And maybe i should write down what i need. What i have , what i did. :slight_smile:
Maybe there is other solutions.