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..
0
Comments
What table is Sl?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
What is not working exactly?
Check with Message that LoyalityPoints.Points * Sl."Net Amount" is getting correct value or not..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav