Pages

Saturday 25 April 2015

Price Change item/ item without price should not print on Receipt: LS Retail 2013 R2

This is small customization in LS Retail for not print price change item in the receipt.

1. Create field in POS Trans. Line (99008981) table and Trans. Sales Entry (99001473) table.

Field No.  Field Name Data Type
50000  Print Line Boolean

2. Codeunit: POS Post Utility (99008902)

Add one line code in funtion: InsertSalesTransaction() 

SalesEntry."Customer No." := POSTransaction."Customer No."; //Existing
SalesEntry."Print Line"   := POSTransLineTmp."Print Line"; // Add Code

3. Create POS Command

Table: POS Command (99008920)

Create POS Command "PRICECH1" similar to PRICECH.

4. Codeunit: POS Transaction (99001570)

        //TRI HS START
        'PRICECH1':
          ChangePricePressed1(MenuLine.Parameter);
        //TRI HS STOP

Write above code after end of PRICECH Case statement.

Create ChangePricePressed1 Function as similar to ChangePricePressed function in the POS Transaction codeunit and add bold highlight code


LineRec.VALIDATE(Price,Dec);  //Existing Line

LineRec.VALIDATE(LineRec."Print Line",TRUE);       //Add Code
LineRec.MODIFY;                                                               //Add Code

WriteMgrStatus;      //Existing Line

5. Codeunit: POS Print Utility (99008903)

Add one line code in funtion as

PrintSalesInfo(VAR Transaction : Record "Transaction Header";Tray : Integer)

glTrans := Transaction;
SalesEntry.SETRANGE("Store No.",Transaction."Store No.");
SalesEntry.SETRANGE("POS Terminal No.",Transaction."POS Terminal No.");
SalesEntry.SETRANGE("Transaction No.",Transaction."Transaction No.");

SalesEntry.SETRANGE("Print Line",FALSE);  //Add Code
OrderByDepartment := GenPosFunc."Receipt Printing by Category";

6. Add PRICECH1 command in Post Command and Post Parameter 0


Thursday 2 April 2015

Block multiple Staff Login with same Staff ID in LS Retail POS (Nav 2013 R2)

Block same Staff Id login at difference terminals at same time in LS Retail POS.

Small Customization

1. Create Field in Staff table (99001461)
   Field Name              Type
   Login by                  Code        10
                                
2. Codeunit -> 10012718 (EPOS Controler)
   Function: LogoffPressed(pActivePanel : Text) : Boolean
     
   Create local variable
   Variable Name         Type              Subtype
    recStore                    record           Staff

@Function start
//TRI HS START 
IF (POSSession.StaffID = '') AND (POSSession.TerminalNo <> '') THEN BEGIN
  recStaff.RESET;
  recStaff.SETRANGE(recStaff."Login by",POSSession.TerminalNo);
  IF recStaff.FINDFIRST THEN
    REPEAT
      IF recStaff."Login by" = POSSession.TerminalNo THEN BEGIN
        recStaff1.RESET;
        recStaff1 := recStaff;
        recStaff1."Login by" := '';
        recStaff1.MODIFY;
      END;
    UNTIL recStaff.NEXT = 0;
END;
//TRI HS STOP

Add bold code between the two line as shown below

  IF POSSession.StaffID <> '' THEN BEGIN
//HS START# Code added to update Login Status field in Staff table
      recStaff.LOCKTABLE;
      recStaff.RESET;
      IF recStaff.GET(POSSession.StaffID) THEN BEGIN
        recStaff."Login by" := '';
        recStaff.MODIFY;
      END;
//HS STOP
    POSSession.SetStaff('');

3. Codeunit -> 99001572 (POS View)
   Function: Login(Manager : Boolean;SetNewStaffID : Code[10]) : Boolean
     
   Create local variable
   Variable Name         Type              Subtype
    recStore                    record           Staff

Add bold code between the two line as shown below

RetVal := POSSESSION.Login(Manager, TmpStaffID, TmpPassword, TmpWorkShift, MessageTxt);

//HS START # Code to block multiple login with same staff ID at POS

recStaff.LOCKTABLE;
recStaff.RESET;
IF recStaff.GET(TmpStaffID) THEN BEGIN
  IF RetVal AND (MessageTxt = '') THEN BEGIN
    IF (recStaff."Login by" = '') OR (recStaff."Login by" = POSSESSION.TerminalNo) THEN BEGIN
      recStaff."Login by" := POSSESSION.TerminalNo;
      recStaff.MODIFY;
    END ELSE BEGIN
      MessageTxt := 'Staff already Logged-in from ' + recStaff."Login by" +' terminal to the POS';
      RetVal := FALSE;
    END;
  END;
END;
//HS STOP

IF RetVal THEN BEGIN

---------------------------------------------------------------------------------

Enjoy...

Sunday 8 February 2015

Setup No. Series in Navision 2013 or 2015

Setup No. Series in Nav 2013 or 2015
Number series is a great feature in Navision that allows automatically insert a number when new record is inserted into the table.
Step by step explain, how to setup a new No. Series on table and use on Page in Navision 2013 or 2015.

Step 1 – Create a number series in table No. Series (308).