Can you put an if condition in a constraint?

BTW do you know if we can put if condition in constraint

You do not need too there are ways to make it behave like that… maybe start a new thread with your question and show me what you are attempting to do and I can help you work through it.

EDIT I will just move this conversation to a new topic…

EDIT: Discussion moved to new topic so we can discuss it in more detail here.

Can you explain what your flow is and why you need the constraint?

Hi @Jesse,
Sorry, to be too picky.
I try to print bill with Discount 10% or Discount $5.
We only have {CALCULATION NAME} and {CALCULATION AMOUNT}.
So, I can’t just put %{CALCULATION AMOUNT}. It also have $ amount too.

Do we have if statement in Printer tag or Constraint?

Oops, Create new topic

Its ok I fixed it…

Have you looked at {CALCULATION TOTAL:X} X would be the calculation type. You can put it in brackets and list both discounts…

[Discount 10%: {CALCULATION TOTAL:Discount 10%}] 
[Discount 15%: {CALCULATION TOTAL:Discount 15%}]

It will not print unless it finds a value for {CALCULATION TOTAL:X}

or try [{CALCULATION NAME}: {CALCULATION TOTAL:Discount 10%}]

the :Discount 10% may not be your calculations name i just used it as example.

Just so I am more clear on your intentions can you show a mock ticket print with what you are wanting?

1 Like

Damn, too easy for you I guess :blush:

How about I want one tag for all % and $ :wink:

How are your calculations being made?

I have 2 Calculation type:
Discount %
Discount $

So, I can key 10 and Discount % for Discount 10%
Or, 5 and Discount $ for Discount $5

Ok so how do you want it to show in the ticket? And can you list the exact names of the calculations… or were those the names?

I want to show exact discount customer get on the bill.

What I mean is you have 2… where in ticket do you want it and how do you want it to look. Can you make a mock ticket print in notepad and type in how you want it to look so we can get a visual?

Date:9/21/2014               Time:11:09 PM
Table 2                                   
------------------------------------------
1x A. Pad Thai.Veggie&Tofu            8.45
1x Fried Veggie Rolls.5pcs            5.00
4x F. Pad Khing.Veggie&Tofu          33.80
==========================================
Discount 10%                         $4.72
Coupon $5                            $4.72
GST:                                 $2.13
Total:                              $39.66
==========================================
   Thank You

So was Coupon $5 the second calculation? Can you list the actual names of both calculations?

Right now I use calculation type name
Discount 10%
Coupon $5

It would be great if I can use calculation type name:
Discount
Coupon

You can switch them to Discount and Coupon… your template you would insert.

[<J00>{CALCULATION NAME}:| ${CALCULATION TOTAL:Discount}] 
[<J00>{CALCULATION NAME}:| ${CALCULATION TOTAL:Coupon}] 

Depending on which discount you used it would look like either of these below.

Date:9/21/2014               Time:11:09 PM
Table 2                                   
------------------------------------------
1x A. Pad Thai.Veggie&Tofu            8.45
1x Fried Veggie Rolls.5pcs            5.00
4x F. Pad Khing.Veggie&Tofu          33.80
==========================================
Discount:                            $4.72
GST:                                 $2.13
Total:                              $39.66
==========================================
   Thank You

OR

Date:9/21/2014               Time:11:09 PM
Table 2                                   
------------------------------------------
1x A. Pad Thai.Veggie&Tofu            8.45
1x Fried Veggie Rolls.5pcs            5.00
4x F. Pad Khing.Veggie&Tofu          33.80
==========================================
Coupon:                              $5.00
GST:                                 $2.13
Total:                              $39.66
==========================================
   Thank You

The brackets around the syntax makes it so it only prints if it finds a value for that specific calculation.

1 Like