Cancel Loyalty Points Discount

Dear experts,

I have a question regarding the Loyalty Points system we implemented on our SambaPos, based on the video tutorial by JTRTech we found on this forum:

If we apply a discount based on the points claimed by a customer, by clicking on the “Apply Loyalty Discount” button, and settle, the points reset to 0 and the button disappears. If customer regret and we cancel or void the products and go back to the ticket screen, the points are reset to 0 and the new unclaimed points appear in negative value. Is there a way to get back the used points automatically into the account? Because in busy days, our staff may not remember the previous points amount.

Thank you so much in advanced. We will be waiting for your reply.


1 Like

Did they reply yet?
I have the same problem and also want an explanation

To cancel the discount you will need to create another Automation Command button, set a new LoyaltyDiscountButton state and then you can reverse equation amounts.

I did this over a few days and my have forgotten a step or two. Please backup your system or try on a test machine first.

New Automation Command button (step 1 of 3):

Add an Automation Command:
Manage->Automation->Automation Command->Add Automation Command.
Clone the “Apply Loyalty Discount”

  • Rename to: Remove Loyalty Discount
  • Change button header:
Remove Loyalty Discount\r$[=F(TN('{CALCULATION TOTAL:Loyalty Discount}')*-1,'0.00')] ([=Math.floor(TN('{CALCULATION TOTAL:Loyalty Discount}')*-100)] Points)
  • In Mappings, change visible state to: LoyaltyDiscountButton=Applied
  • save.
    (You may want to sort your automation Commands so that the Apply and Remove are next to each other. This will keep the buttons from jumping around when apply and removing the loyalty discount.)

Change current rule (step 2 of 3):

In the rule: Apply Loyalty Discount Button, 5th action called Update Ticket State - Generic in the new state field put Applied.

Create a new rule (step 3 of 3):

Create a new Rule called Remove Loyalty Discount Button
Rule Name: Remove Loyalty Discount Button
Event Name: Automation Command Executed
Automation Command Name Equals Remove Loyalty Discount
Add actions:

  • Update Loyalty Card Points
  • Apply Loyalty Discount
  • Update Ticket State - Generic

1st action (Update Loyalty Card Points), add this formula to the points field:

[=TN('{ENTITY DATA:Loyalty Card:Points}')-TN('{CALCULATION TOTAL:Loyalty Discount}')*100]

2nd action (Apply Loyalty Discount): leave the Amount blank.

3rd action (Update Ticket State - Generic):
State Name: LoyaltyDiscountButton
Current State: (blank)
New State: Available
State Value: (blank)


When removing a calculation and other actions are depended on the calculation, you want to make sure the removal of the calculation will happen after other calculation are needed. Otherwise, if you removed the calculation first, the other actions will not have the calculation available for other actions. In this case the Update Ticket State - Generic does not need any calculation.

You should now be able to toggle Loyalty Discount Calculation.

1 Like

Good day @Bob_be

I have followed this tutorial of yours to the dot and even made some changes to the steps but still nothing happens when i click on the Remove loyalty points button

If you don’t mind and have some spare time, is it possible that you could help me again?

Nevermind. I figured it out
THANKS ALOT for the help

1 Like