Close ticket rule

The only use I might see this being relative would be a Happy Hour… If you spill over into Happy Hour time while in middle of a ticket and you would want it to reflect the Happy Hour prices without having to cancel and restart a ticket.

Happy hour can occur in the middle of a ticket. Thats why prices can change by time. In version 47 close ticket action us not working…
Do not knoq why.
I am setting a trigwr that exec every weekday at 8pm enabling happy hour and one triggwr that exec 9pm to disable happy hour.
When ypu are in the middle of creating a ticket and the trigger exec it asks if ypu wamt to enable happy hour. If yes it should close ticket (not dping) and change price list (doung it corrwct).

Thanks

G

Ah! I see now… that’s being really nit-picky about happy hour imo.

I have happy hour triggers as well (price tag HH), but if I have a ticket open before the trigger executes, that’s too bad. Closing and re-opening the ticket will allow the Price change to come into effect, so the next drink they order will have HH pricing. Of course previous orders on the ticket will have regular pricing.

Close Ticket not working on v47? My screens indicate my test was done on v46. I’ll upgrade to see if it stops working…

edit: updated to v47, and it still works… Switch Price List button closes and repoens ticket, with new definition active.

So my button works, even in the middle of Ticket creation, but the Trigger fails to close the ticket.

I see the trigger executing, since it displays messages, but the ticket never closes and reopens…

1 Like

I’m thinking triggers operate outside of a ticket. Load ticket should work. But how would you know its loading the ticket your on.

So… it was not me dping things wrong… LOL!! This should be the first time jajjajajajajajajajsjs

Thanks

G

It will let you close ticket if it comes from an automation command. But it seems that if you set a trigger to execute an automated command it will not fire when trigger executes.

I tried using the Trigger Executed rule to trigger an action that executes a command then set a rule that on the executed command change price list, close ticket. the trigger worked but the actions did not. I double checked and the logic was right it should have fired.

So it seems triggers are only working with specific actions and not all of them?

OK first of all let me give you some background information. We store prices in cache. That means as you add items to tickets SambaPOS does not read prices from database. When change price list action executes it raises a flag to clear cache and read prices from database. However if there is an open ticket we intentionally do not clear cache as soon as trigger executes. Since we can not determine when a trigger executes it may cause unpreventable errors. For example think of price change executes in the middle of the millisecond we’re calculating discounts and taxes. We can never know the issue relates to a trigger so I completely queue such methods to work after ticket close and it generally completes until it displays the entity screen or what comes next. Caller-id users will experience same behavior. SambaPOS never displays phone number popup (even multiple people calls) in the middle of the ticket creation. It displays queued popups as you close ticket.

So that might seem an error to you but there are rules :slight_smile: We created them to protect stability.

In fact we don’t need triggers at all to implement happy hour. Like @Jesse pointed few posts before we can implement an “apply happy hour price” action with Update Order action and execute it after Order added to Ticket if {DATE:HH} > 20 & {DATE:HH} < 23. That will also work fine in the middle of ticket creation.

2 Likes

I had a hunch it was like this but I thought I would try and help gerlandog work through it to see possibilities

That method of Happy Hour looks like it would be a better solution vs using triggers.

Dear @emre, I fully understud what youwrote that is why my original question was why the close ticket action does.not work in my rule. I wouls likw to close the ticket so the change price list action can complete.

Thanks

G

I could be wrong, but if I am understanding Emre right its not working because you were calling it from a trigger… triggers will not work until the ticket is closed…

So, the only part of the rule that is not working is the CLOSE TICKET action… becuase the MESSAGE, CHANGE PRICE LIST are working…

Why CLOSE TICKET would not work?

Thanks!!!

G.

Out of curiosity do you assign customers to the ticket before this rule would be applied?

no, Customers no, but there is allways a table assigned.

G.

I still think its because its being fired from a trigger. Maybe close ticket action cannot be fired from a trigger to preserve stability.

I will do this excercise… I will ad a close ticket rule to an ORDER ADDED rule… to see what happens…

g.

Close ticket works just fine within rules I use it in my system quite a bit. We do not know all of the rule restrictions put in to protect stability maybe one day we will.

EDIT: I just added it to my Order Added rule and it closed ticket immediately after adding my first item.

I really think this was unique to your attempted use of it. I think it will not fire from a trigger.