Dine In or Takeaway Help

One option would be a [?prompt] but for simplisity you would want numbers to be straight numbers without T or other letters and a numberpad keyboard on your prompt.
The prompt would go in I imagine a change ticket entity action so you would ger a prompt for table with a entry field and a number type keypad.

Although is you dont have an entity grid to select table what was you plan for opening tickets after initial close, ticket lister or are all ticket paid straight away every time.

Here is an example of Ternary Operator expression use in a printer template.

1 Like

@JTRTech Sorry I may not have been so clear. Currently I have 3 entity screens when clicking POS. “DINE IN OR TAKEAWAY”… “ALL TABLES”. “CUSTOMER SEARCH”…

When user Presses POS, they would only see 2 screens, “DINE IN OR TAKE AWAY”… “CUSTOMER SEARCH”… “ALL TABLES” should not be there. However under “DINE IN OR TAKE AWAY” entity screen, there are two buttons. “Dine in” “Take Away”… When they click “Dine In” it will go to table number selection. When selected, if the ticket is paid on spot, then it just goes back to “DIne In or Takeaway” Entity screen… If it’s paid later then I would create a separate entity screen that only shows Open orders, in which user can scroll through.

@Jesse Thanks kendash. I took a look at the post and the ternary script. I can read and understand it, but in this case, how would I be able to do it for something like this?

[=TN(’{TICKET TAG:SG}}’) = Take Away ? ‘{TICKET TAG:SG}}’:"]?
Would I do something like this?

Another way I was thinking was, Implement a ticket tag that toggles between dine in or take away. Then the only thing I would need it to do, would be when Dine in is pressed, the user would input a table number, which would then be printed on their receipt and kitchen order. And if I insert that Ternary into the ticket template then it could select between Dine In or Takeaway.

The only thing I would want it to do then is , when a Table number is inserted, it puts the Table number instead of the ticket number.

IN this case, what would I change in the ternary equation?

Not sure exactly what TN stands for (thinks its Turn to Number or at least thats how I think of it.
What is {TICKET TAG:SG} goig to return?
Also you have two }} after it…
If the tag is Takeaway or Dinein it would be more like;
[= '{TICKET TAG:SG}' == 'Take Away' ? '{TICKET TAG:SG}}' : " ]
Am no pro on this function but definatly want to loose the TN.
Also single = along with > and < only work with numbers.
When working with strings (text) it would be either == or != (equals or not equals).

[=('{TICKET TAG:SG}' == 'Take Away' ? '{TICKET TAG:SG}' : '')]
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^   ^^
         condition to test                    |           |
                              when condition is TRUE      when condition is FALSE
  • When the SG Ticket Tag is equal to Take Away, it will print the contents of the Tag, which will be Take Away.
  • When the SG Ticket Tag is not equal to Take Away, it will print nothiing ('').

JTRTech. Yeah I knew I had a few things wrong. but @QMcKay figured it out on how I should get it to work.
{TICKET TAG:SG} would return either Take Away or Dine in.

@QMcKay So If I did
[=(’{TICKET TAG:SG}’ == ‘Dine In’ ? ‘{TICKET TAG:SG}’ ‘{TICKET TAG:SG}’ == ‘Take Away’ | ‘{TICKET TAG:Order no}’)]

would it say " When the SG Ticket tag is equal to "Dine In, it will print the content of the tag which will be “Dine In”
When SG Ticket does not equal Dine in, it would Print “Take Away” with Ticket Tag content of “Order no”…?

[=('{TICKET TAG:SG}' == 'Dine In' ? '{TICKET TAG:SG}' : '{TICKET TAG:SG}' + '{TICKET TAG:Order no}')]

That assumes you have a Ticket Tag named “Order no”, which IMO does not make much sense.

Well I have another Ticket Tag named Order no. which pretty much puts a generated number which can be reset upon ending work period. This would be the take away number for the customer.

Basically what I want to try and make it do, is when Dine in is selected, it also puts the Dine in Table Number which is a number inserted by the user or the table number becomes the table selected when Dine in is pressed. When take away is pressed, it puts the auto generated number under the ticket tag : Order no.

That’s what I want to really accomplish. Do I make sense?

Also, the last part where it also puts the ticket tag: Order no. in the ticket template, could I make it so that prints on the next line, under the the equation?

No. It will print wherever the expression is located. You can try linebreak characters to move it down…

\r
<linebreak/>
<br/>

The above are line break tags that behave in slightly different ways, and some may not be valid in a printer template, so experiment with them until you get what you want.

[=('{TICKET TAG:SG}' == 'Dine In' ? '{TICKET TAG:SG}' + '{ENTITY NAME:Tables}' : '{TICKET TAG:SG}' + '\r' +  '{TICKET TAG:Order no}')]

Alright sweet. I’ll test this out and update :). Thanks for the help.

Just one more question. Just to clarify, In my custom entity display, Take away and dine in are the buttons.
When dine in is selected, A table number must be picked before it creates ticket. When a table is picked, how could I automate it so that when a table is picked, it automatically inserts the ticket tag as Dine in.

When take away is clicked, it creates a ticket straight away, when this is done, I would want it to put Take away ticket tag as soon as its created.

Use Update Ticket Tag Action in the same Rule.

Another method is use Ticket created event and constrain to tables entity type.

Which rule do you mean? The rule I created for Dine In button simply just goes to the table number selection.

I looked at the possible rules that I could use the update on, but I don’t see any.
I think I might be making this more complicated than it actually is lol.

Hey guys. Finally coming back on track, but thought of a different way. wanted to see if this was possible.

I felt I was making this more complicated than it has to be. I have a feeling that through actions and rules defined by ticket tag type, I could get it to print individual print templates.

I’ve created in Printer Templates
1- Dine In Receipt Template- It will print {ENTITY NAME: Tables}
1- Dine in Kitchen Template- It will print {ENTITY NAME: Tables}
1- Take Away Receipt Template- Prints Ticket number based on {TICKET TAG:Order No}
1- Take Away Kitchen Template- Prints Ticket number based on {TICKET TAG:Order No}

1- Print Job for DINE IN Receipt- Assigned to DINE IN RECEIPTTEMPLATE
1- Print Job for DINE IN Kitchen- Assigned to DINE IN KITCHEN TEMPLATE
1- Print Job for TAKE AWAY Receipt- Assigned to TAKE AWAY RECEIPT TEMPLATE
1- Print Job for TAKE AWAY Kitchen- Assigned to TAKE AWAY KITCHEN TEMPLATE

Now, I’ve setup 2 ticket tags named DINE IN & TAKEAWAY. What I’ve done is, I’ve made it that when TAKEAWAY ticket tag is selected, an ORDER number is automatically assigned.
When DINE IN ticket tag is selected, it doesn’t have ticket tag.

Could I make it so that when DINE IN entity is selected, and ONLY when a TABLE number is selected, it automatically attaches the DINE IN ticket tag.
And when TAKEAWAY is selected, it attaches the TAKEAWAY tag…

Also is there a way through Actions and Rules that when a table number is selected, it automatically prints the DINE IN receipt and kitchen print template. And likewise for TAKEAWAY, it would select the print the TAKEAWAY receipt and kitchen template?

Or is there another less complicated way to implement this?

UPDATE: I did try to use that ternary expression, didn’t work out. I think It had something to do with the way I setup my ticket tags, since then I have deleted the extra ticket tags and just left the DINE IN as a separate ticket tag and TAKEAWAY as another ticket tag that can be pressed.

I’m thinking the process would be similar to how we used ORDER NO ticket tag to automatically assign an order number to the ticket, which auto increments and resets after WP has ended.

You have some good ideas and definitely worth a try. I have some suggestions to make these conversations more constructive and help you get better suggestions faster. When you tell us that you tried something but it doesnt work please show us your work that you tried via screenshot. Often it could be a typo or wrong use of syntax and a second set of eyes can catch it for you.

Always provide detail of what you tried with actual examples otherwise we can only guess at what it might be. If its a simple mistake we may never catch that unless you provide us examples.

That’s a fair call. I will try to add more screen shots and provide more accurate information to give you a better picture of what I have done and tried. I really want to show you a small video example like a GIF I see you guys use when wanting to show something rather than simply screenshotting, I just don’t know how to do that.

Below is the screenshot of my ticket template


And my Print JOBS

My Dine in and Takeaway Entity screen


Currently, when you press DINE IN, it goes to

And of course when TAKE AWAY is selected, it goes to

Currently,
A user has to manually select DINE IN or take away regardless of the method they choose on the entity screen.
Once a selection is made.

At the moment, when DINE IN tag is selected, It just doesn’t print the TICKET TAG:Order NO(A auto increment generated number) But since the ticket template still shows YOUR ORDER NUMBER IS…

It shows as the highlighted text shows… But without the Order number because it’s not tagged on the ticket.

So in a sense, it was doing what I wanted it to do, but to me it made no sense why on the customer receipt it should still show “YOUR ORDER NUMBER IS” without an order number.

This is why and where I decided, its best to create 2 print jobs and templates, each specifying DINE IN or TAKE AWAY as shown in the screenshots above.

Now what I want to try and make it do, is when a user picks a table number, it automatically attaches only the DINE IN ticket tag, and when it prints the receipt, it would use the DINE IN print jobs.

When a user clicks TAKEAWAY, then there is no table number attached, therefore it automatically tags the ticket with TAKEAWAY and Order No tags, prints according to the print job TAKEAWAY.

I think the use of custom constraints could help me do this, but honestly, I’m not sure how to configure custom constraints. I’ve added many features following tutorials, and I’ve seen what type of constraints are used, I just don’t know how to really tie it together.

So far I have created 2 actions.
Here are all my actions so far


Action for Receipt Dine in

Action for receipt take away

Action for Kitchen Dine in

Action for Kitchen Take Away

In the rules
I have a rules which fires when TAKE AWAY ticket tag is press, it attaches an order number also.


This is the rule for tagging DINE IN on ticket when DINE IN tag is selected.

Now I need to create a rule which fires a print job based on the ticket tag selected. Can this be done by simply creating only 1 rule, or would I need 2 rules, to execute separate print jobs since I have 2 for each tag?

Sorry didnt read the whole post but based on the last paragraph;

You can do it either way, either separate rules which rule constraints OR a single rule with action constrains.
Can be advantages to either method.

Ok I have made 4 actions. 2 for Dine in(Bill and Kitchen) and 2 for Takeaway(Bill and kitchen) .

What event do I put the actions under to start configuring?

At what point are you defineing dine in or take out, that entity screen right.
What are the buttons? entity or automation commands?