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.
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: 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…
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”
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 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 …
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.
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.