Customer will not load

Try {ENTITY DATA:X} Matches Y

still doesnt do anything :frowning:

ive tried all sorts of combinations from changing YN to numbers, using match, using equals but it seems {ENTITY DATA:X} doesnt work with the keypad value action??

If you display a message, is it showing a value for {ENTITY DATA:X} ? If not, that is the issue; try:

{ENTITY DATA:EntityType:X}

like:

{ENTITY DATA:Customer:X}
1 Like

Like @QMcKay mentioned I too am pretty sure it should be:

{ENTITY DATA:EntityType:X}

I have used this syntax before when helping someone else and it had to be set like this or it did not work. So yours would be.

{ENTITY DATA:Staff:Discount 10}

Let us know if this works or not.

still doesnt work, and ive tried equals and matches in the constraint :frowning:

In the HH and VIP Discount setup, we use Entity Data in constraints, so so it does work in that case.

I think the issue here might be that no Entity is loaded, so there is no data to make the comparison. Use a Display Message Action to ensure the data is available to the Rule. I think you will find that there is no data available. Place a message before and after the Load Staff Member Action. The first one will come up blank, while the 2nd one will likely show data, given that you use the correct syntax.

If my guess is correct, you will need to separate the Constraints and Actions into 2 Rules, and use something like Execute Automation Command Action to fire the next Rule, after the Entity is loaded, and there, check the Custom Data.

1 Like

Sorry didn’t have time to read that from beginning but I thought @QMcKay is right when I saw the screen shot on this post.

Constraint Checks works before executing actions. As you load entity with an action you can’t test it with a rule constraint. Like @QMcKay recommended chaining a new rule by executing Execute Automation Command will work fine.

Another alternative might be doing it by handling Ticket Entity Changed event. You’ll update customer entity when numberpad value entered and decide promotion by creating a rule for Ticket Entity Changed event.

1 Like

Hi @emre thats what ive done :slight_smile: ive got my rule to load the entity (Staff) then i used the Ticket Entity Changed event to apply discount using {ENTITY DATA:Staff: Staff Discount 10} equals Y or N and it works perfect

EXCEPT - i have 100% discount everything works but i get the screen switch issue and logoff doesnt work properly, main menu buttons disappears and POS acts like non admin user has logged in again. This only happens when doing 100% off (i have this set up as a payment and not a discount, that could be the issue?) ive tried adding refresh ticket action but that doensnt have any effect, do you have any ideas?

Screen switch thing relates with ticket refresh. If you force sambapos to logout while sambapos tries to update ticket it will happen.

After my rule has run hasnt the ticket finished being updated? all the actions in the rule have happened and ive checked that by looking at the completed ticket. After ticket is fully settled i have another rule that kicks in to log out, in my 100% discount rule it is setup as a payment type so when that rule kicks in it pays 100% of ticket, then the logout rule kicks as full payment is taken

I have now changed my setup so the discount is a calculation type and not a payment method and all works great. The only issue is when i discount 100% everything works fine but the ticket doesnt close and log out. I have a payment processed rule that closes ticket and logs out after payment processed but since there is no payment being processed when 100% is discounted this rule doesnt kick in.

I added close ticket action to my 100% discount rule and this closes the ticket and sets the POS ready to take a new order and create a ticket, at this point the main menu button works so i can exit the ticket manually. so at this point samba isnt updating the ticket as all actions have happened and ticket is reset for a new order. If i add the logout action to my 100% discount rule after the close ticket action the screen switch happens.

Is this an error? is there anything you can do @emre so that when ive added my logout user action the ticket will logout properly?

Try adding logout to Ticket Closed instead. Just use some constraints with it to get it behaving how you like.

if i add logout user action to ticket closed i get screen switch

Or create any new rules that will logout using constraints to match the 100% transaction i get screen switch

also if i use sambas built in logout setting in Settings -> Terminals and click the tick box next to auto logout the same screen switch happens

you have a rule that is firing and conflicting with it then. Something must be messing with tickets still causing it.

Try putting execute automation command to your 100% discount rule and then make that execute automation command trigger logout.

I dont know what is conflicting because i removed my auto log out rule completely so it didnt work for any rule, then just added it to 100% discount rule, didnt work still got screen switch. i tried auto command that didnt work and still got screen switch and also tried just using sambas built in logout in terminal setting and that results in screen switch.

@emre suggested its because the ticket was still updating but it isnt, any rules have processed, nothing else is happening the ticket is just showing on the screen and nothing seems to log out when 100% discount is used

any more ideas?

Update ticket entity action designed to change entity of a ticket and create a ticket if there is no active ticket. After rules works It tries to refresh ticket to show updated entity related data so it brings ticket to front. I’ll check if we can change that behavior without affecting current users.

Thanks @emre for looking into it