Customer will not load

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

Hi @emre did you figure out if there was a solution to this?

@emre ive also tried adding close and logout actions to the gift rule, so if all items on the ticket are gifted the ticket closes and logs out, this also gives the screen switch issue

This is with and without any entities being added so it isnt just an entity added issue

Hey RickH how did you get
Actions:
AT_TicketType Name - Sale - Staff Discount

Enable Auto Receipt - Staff Discount

Refresh Ticket

The Ticket Type is probably an action to change the Ticket Type.
The Auto Receipt is part of the Auto Print system I shared here:

http://forum.sambapos.com/t/database-import-tool-pre-built-solutions/2797

He modified it for his setup.

BTW i did a quick search on forum and found

Maybe that can help you. If you get enough knowledge of the various methods you can maybe make one to fit your needs.

BTW Refresh ticket is just a Display Ticket action with 0 for Ticket Id. This is useful for some functions that need a ticket refresh to show. Not everything needs a ticket refresh.

@Jesse is correct i modified some previous help i had to suit how i want my setup, as per the other post ill try and create a full tutorial soon and post for you