Lopyalty Point Calculations

aamollaamoll Member Posts: 42
How can I calculate the loyalty points based on net amount rather than amount.
Following code of codeunit "pos loyalty collection":
Sl.SETRANGE(Sl."Entry Type",Sl."Entry Type"::Payment);
IF Sl.FIND('-') THEN REPEAT
LoyalityPoints.SETRANGE(LoyalityPoints."Qty/Amount Limit",0,ABS(Sl.Amount));
LoyalityPoints.SETRANGE(Type,LoyalityPoints.Type::Tender);
LoyalityPoints.SETRANGE(LoyalityPoints.Code,Sl.Number);
IF LoyalityPoints.FIND('+') THEN BEGIN
IF LoyalityPoints.Points > 0 THEN
Points := Points + (LoyalityPoints.Points * Sl.Amount)
ELSE //Payment
RegisterPoints(LoyalityPoints.Points * Sl."Amount In Currency",1,
"Loyalty Scheme","Loyalty Card No.",
"Order No.","Posting Date","POS ID","Sell-to Contact No.",
Sl."Store No.",TransactionNo);
END;
UNTIL Sl.NEXT() = 0;

I am changing the code as
Points := Points + (LoyalityPoints.Points * Sl."Net Amount")
but its not working..

Comments

Sign In or Register to comment.