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...
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...
Retail POS Software in UAE, Single Lisence Software in UAE, Cashiers Software in UAE
ReplyDeletehttps://gccgamers.com/retail-pos-software.html
Retail Software in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee.
1634629447006-8