Customer will not load

Ok ill have a look at that that might make it simpler actually, ill let you know how i get on :slight_smile:

Still doesnt work, if i use a new field called discount and have either Y or N, the non discount rule still works as it did before, but the discount rule still does not

Ive even renamed my customers entity from customers to cust, deleted and remade all actions and rules and exactly the same thing happens non discount works but discount does not.

Im really stumped because my staff discount version works perfect and the customers version is based on the staff version

Its as if the built in customers entity does not allow more than one rule to be applied to it???

im going to create another entity called customers2 and see if that works

Did you set default mapping for rules? Your changing ticket type… the ticket your changing too does it have Customers Entity Type linked under

 Tickets > Ticket Type > Your Ticket > Entity Type List
1 Like

Ill double check, that might be the issue!

I created a new entity and i cant even get that to load on ticket now just with a simple action an rule using numberpad value entered linked to customer number

Im going to restore backup and check ticket type for linked entity, im thinkin that might be it as thats the only other thing i havent checked, ill let you know if it worked, thanks again

that wasnt the issue either, i didnt have any entities mapped to my ticket types and staff discount rules work fine. im thinking i might start again, get rid of the number constraints and try the additional field with YN answer. the issue is definitely to do with the action to add entity to ticket (change ticket entity) as when that action is all that is in the rule is doesnt work/linked with an error linking to the entity i just cant see it so im going to try from scratch again :slight_smile:

it seems when using the “Numberpad Value Entered” action you cannot use {ENTITY DATA:X} in the custom constraints???

Ive setup a separate field in my staff and customer entities for discount 10 and I enter either Y or N. Now i have set all my staff with employee numbers of 7 digits long so when entered in the keypad the rule will kick in. If I setup my rule as below then everything works (but i havent used the discount 10 Y or N constraint so every staff member when swiped or scanned has 10% discount applied as below)


So to limit the staff discount to specific employees ive setup the following Discount 10 and Discount 100 fields on my staff entities (100 gives me 100% discount so is not used for normal staff)

if i add these additional Y and N constraints to my rule as shown above this stops the rule from working and the staff entity is not loaded to ticket, the state doensnt change and no discount is applied. This has been the only change since the first screenshot above where the rule worked for any staff member. when adding the Entity Data constraints the rules does not work so either im not typing the correct format for the constraint or {ENTITY DATA:X} cannot be used here?? im hoping someone will tell me im typing it wrong?? @Jesse

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