LS Retail POS Customization Rounding balance amount to nearest 50 fils

Hey Guys, Another interesting customization on LS Retail POS.

Customization Description

Client wants to Rounding balance amount to nearest 0.50 fils at the POS level. Currently cashiers facing difficulty in calculating the figure to make a round amount. This functionality will provide assistance to cashiers and reduce customer waiting time at the counter.
Requirement divided into two phases. First phase client wants only the pop-up message. As an example “Do you want to donate the 0.05 fils to charity or you want me to load it to your wafa account?” at the POS level.
If there is nothing to round, but client wants to pop up message. As an example “Do you want to donate the 0.00 fils to charity or you want me to load it to your wafa account?” .
As per the client requirement, when cashier click “OK” on the pop-up message system should proceed to tender mode. If cashier wants add or modify, he/she has to come back.

Customization effected area

Customization has done inside POS Transaction Codeunit (99001570) . Documentation trigger mentioned the customization details.

So I created new function in POS Transaction CU called RoundCalc

RoundCalc Function >> This function consist with one parameter which is called Amount .It is Decimal type. It doesn’t has any return type. There are two local variables RoundedAmount : Decimal , TxtMsg :Text 250 .Also it has Local Text Constant which is RMSG : Do you want to donate the %1 fils to charity or you want me to load it to your loyalty account?.

Here is the code

PROCEDURE RoundCalc@1000000012(Amount@1000000000 : Decimal);
 VAR
  RoundedAmount@1000000001 : Decimal;
  RMSG@1000000002 : TextConst ‘ENU=Do you want to donate the %01 fils to charity or
 you want me to load it to your wafa account?;
  TxtMsg@1000000003 : Text[250];
 BEGIN
  // RoundCalc
    RoundedAmount := ABS(Amount – ROUND(Amount,0.5,’>’));
    TxtMsg := STRSUBSTNO(RMSG,FORMAT(RoundedAmount,0,'<Precision,2:2><Standard Format,0>’));
     PosMessage(TxtMsg);
 END;

This function is called inside the TotalPressed function after CalcTotal. This TotalPressed function is standard LS function. And passing the Amount to the RoundCalc function.

Example

RoundCalc(REC.”Gross Amount”);

Leave a Reply

Your email address will not be published. Required fields are marked *