How to create Close Ticket button with Confirmation

In this tutorial I’ll show you how to create a Ticket Close button that asks if order is ready to print to kitchen.

We’ll start by creating Close & Print Command button. I’ll create a new Automation Command for this.

We’ll map this command button to appear Under Ticket.

After saving button we should see two close buttons under ticket.

:bulb: Of course we don’t want to see these two buttons. After implementing Print & Close button function we’ll configure how they’ll appear.

We want to display a confirmation when Print & Close button clicked. We’ll use Ask Question action for that. Create a new Action and select Ask Question as Action Type.

Important: In SambaPOS clicking buttons triggers Automation Command Executed rule. For buttons that are visible on the screen we need to create new Automation Command like we did for Print & Close button. For commands these don’t appear as a button like Handle Print Kitchen Question command there is no need to configure an Automation Command.

Now we’ll create a rule that handles Handle Print Kitchen Question command.

Handle Print Kitchen Question won’t appear in drop down list as we didn’t configure a button for it. You can just type or paste command name in constraint. This rule executes Close Ticket action if operator selects Yes option.

We programmed how Ask Question action executes Close Ticket action when Operator clicks Yes button. On next step we’ll create another rule for Close & Print button that executes Ask Question action.

Ask Print to Kitchen button is the button that appears under ticket with Print & Close label. When operator clicks that button…

  1. SambaPOS Executes Ask Print Kitchen Question action.
  2. That Displays the question with Yes & No buttons.
  3. Clicking Yes triggers Close Ticket action.
  4. Clicking No does nothing. Just returns back to ticket.

On this step we can test how Print & Close button works. Clicking Close & Print ticket should display question. Clicking Yes should close ticket and clicking No should stay on ticket.

Finally we’ll configure how Close and Close & Print buttons appears on ticket. We’ll show Close Ticket button by default. Close & Print button will appear when there are new order lines in ticket.

When there are new order lines in ticket, Ticket State becomes New Orders so we can configure Close & Print button to appear when ticket state becomes New Orders. Edit Ask Print to Kitchen command button and configure button mapping edit Visible States value.

Now we can test how Print & Close button works. When new ticket we won’t see this button but when we add orders this button should appear.

On final step we’ll configure Close button to appear when there are no new order lines in ticket. In other words we’ll show Close Button if Ticket state is one of New,Submitted,Paid,UnPaid states.

If you’ve configured additional ticket states you should also include them here.

Now depending on ticket state you should see either Close or Close & Print button under ticket.

3 Likes

This works but one issue I see is that when someone opens a ticket with orders submitted, than adds a item with have the print & close button, he cancels item but we still have that button. So now can only close by pressing print & close button.

You would probably want to add a constraint to the confirmation which counts the order state =new is not 0.
I have that on mine so if there are no new orders it just closes straight away but to do that you need to put that constraint on the ask question action and a second action in that rule of close ticket but constrain the close ticket action to count order state=new is 0 so ont one of the two actions will happen at any time.

You can create a rule like that to change ticket state when operator cancels orders.

{ORDER STATE QUANTITY TOTAL:New} returns total quantity for new orders. If it is 0 that means there are no new orders in ticket and we update ticket status to Submitted. (if it is New Orders)

hey just downloaded you V5 but neeed help o delete some repost & how to register the sambapos5
awaiting for ur reply

to register you need account at sambamarket.com and to buy the licence then login on samba and activate licence.