Close ticket rule

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