Don't submit orders on ticket close

Is there any way to avoid orders being submitted when the close button is pressed?

When I have an entity assigned to a ticket and then I close the ticket the order is submitted and this then means I need to go through the void process to make changes.

Is there any way to prevent the submission of orders when the close button is pressed.

I have read this:

But although it doesn’t change the order state to “Submitted” and it doesn’t print a kitchen ticket, the orders are still to some extent submitted.

Can this be avoided?

The Order State (Status) is hard-coded in the Close Ticket Action and I don’t think you can prevent that. That said, I see some parameters in that Action that I don’t remember being there. Not sure what they do… maybe Keep Open if Not Paid will do what you want? EDIT: Nope!

##You can disregard all of the following… see my next reply for the solution.

Anyway, failing that, you need to update the Order State named “Status” from Submitted to New.

When the Ticket is Closed, you probably then need to use Load Ticket action, followed by Update Order State Action.

1 Like

Wow! - Would never have found that. I was looking in rules, not actions. I was expecting to see a rule with something like

  • Submit Orders
  • Update Order States
  • Close Ticket

But no - This is handled from within the Close Ticket action.

Setting Keep Open if Not Paid prevents the order being submitted so it remains as NEW when you re-open the ticket.

Exectly what I was looking for.

Thanks @QMcKay

Well, I tried it, and if that is set to True, you can’t Close the Ticket at all.

BZZZZT! WRONG!!! (I knew that ^ didn’t sound correct)

Here is what you want … you already have this Rule, and so I was wrong, the Status change is not hard-coded … you need to disable the Update Order Status action (which is an Update Order State Action). You can do that by using 1==2 in the Constraint if you don’t want to delete the Action… that is what I would do.

:warning: WARNING: that is a Default Rule, so disabling that Action in the Rule can probably really mess up a lot of things in your State Flow and even Reporting.

Ah - Yes, I have just noticed that, but when I am using this action as part of my rule it is working how I want it. I will need to keep the standard Close TIcket unchanged and create a new action for use in my rule.

Disabling the action you mentioned above was my first thought before starting this thread. But if you do this then the order DOES get submitted, the only difference is that the order status isn’t updated.

But when I disabled these actions, closed and re-opened the ticket I ended up in a strange position where the order has been submitted, but still has a status (now inaccurate) as “NEW”

Standard functionality: Order is submitted and tagged as submitted

Don’t update order state: Order is submitted, but the state says “NEW”

Keep open if not paid: Order is not submitted and order state remains as “NEW” - This is the functionality I wanted

Not sure why it’s possible to achieve this as part of a rule, but not possible when just pressing the “Close Ticket” button…

1 Like

What do you mean by this? How is it “Submitted” if the Status State remains as New? Canceling an Order rather than needing to Void it is dependent on the Status State still being New as opposed to Submitted.

I don’t think that’s true… The apprearance of the buttons is dependant on the state, but if you do the 1==2 trick, and then try to cancel one of those orders, you’ll find it doesn’t work.

See the thin grey line I have highlighted below, this seems to be the true giveaway as to if the order has been submitted or not. The state seemt o only be a visual indictor. When the order has not been submitted, this yellow bit says “New Order”

My guess was going to be that when you say “Submitted”, you are referring to the fact that it has been written to the DB. That happens on Close Ticket.

Before that, the Order is in memory only, so it can easily be Canceled. I am surprised that you can Cancel after it is written to the DB, but hey, might have learned something new today.

The state might not be Submitted but the data IS ‘submitted’ to the database.
Once a ticket is closed the orders WILL be entered into the database.
The closest you can do is mimic cancel with a custom flow however the ordered will still be logged in one way or another.

I created a Cancel button which pretty much voided submitted orders but as Canceled rather than voided.
They show on reports as ‘Hold Canceled’
I have a hold setup and on unholding the ticket the previously held orders are set to behaive like New orders using a custom state to format as new ‘FNew’ while actually being submitted still.
Aditional states make a ‘Cancel’ button visable for these orders which is a seccond void equivilent.
This button unlike void is not constrained to manager/admin meaning any user can cancel (void) an order which has been one hold and not sent to kitchen etc.

I think you are correct.

When there is an Ord.No: in that yellow section it has been submitted to the DB and cannot be canceled (needs to be voided).

When there is no Ord.No: in the yellow section is has not been submitted to the DB and can be cancelled.

By enableing Keep open if not paid it seems like it’s possible to close the ticket but leave the items in the order list (But this only seems to be possible as part of a rule).

FYI - The rule which I am using is

  1. cloning a ticket (with all orders)
  2. changing the ticket type
  3. closing the ticket (with Keep open if not paid)
  4. re-opening the ticket to see the ticket type displayed correctly

I guess what I am trying to answer for myself is if you set Keep Open if Not Paid to True, are Orders written to the DB, or not?

If they are not written to DB, then they must only be in memory, and if you shutdown SambaPOS, they will disappear altogether, which is not good.

So maybe they are written to DB anyway, but somehow, you are still allowed to Cancel them after Closing. Not sure how that is possible.

I can’t figure a way to test this, since I can’t even close a Ticket when I set Keep Open if Not Paid to True.

EDIT: this Locked column must be the key to it all … I am betting the Order IS written to the DB when the Ticket is Closed, but the Locked column is set to 0 instead of 1 when you set Keep Open if Not Paid to True in the Close Ticket action …

Prob a silly question but have you got entity or ticket tag assigned too?

Yes, I have an entity assigned the whole time.

In the instance in which I am using it, the ticket is only closed for a fraction of a second before being re-opened. This close and re-open is my solution to not being able to refresh the ticket screen when the Ticket Type gets updated.

I am not changing the default behavious throughtout SambaPOS, I am only doing this in the one rule.

Yup … I cannot Close this Ticket using the Close Button. Not sure why.

IIRC, emre said Locked is there for a reason (anti-cheat I guess) when he responsed to question about add/edit order tags after submit. We can set Lock to false with Update Order Action but he said is not recommended. I think it is the same Lock he was talking about.


Because in all my tests I was adding the same items to the ticket, I didn’t realise that the new ticket I was loading as part of my rule was actually loading slightly the wrong ticket.

The close command is NOT being executed even as part of the rule, which means it’s not possible for me to get a TicketID without closing (and therefore submitting) the orders.

My main desire in all of this is to change the ticket type and have the associated buttons on the ticket screen change too, but I just can’t figure it out.

OK, it looks like I will have to deal with submitting these order and then automatically unlocking them once the ticket is reloaded.

You can try using Save Ticket action, which should commit the Ticket and Orders to the DB.

Unfortunately, SAVE TICKET doesn’t seem to give me access to the TicketId to allow me to re-load it.