From 261e13ceac556d7c323b7cfac3a6ed269fcff7f6 Mon Sep 17 00:00:00 2001 From: "Infineon\\StieberD" Date: Wed, 8 Oct 2025 12:46:07 -0700 Subject: [PATCH] Removed Out of Service calibrations from notifications being sent --- LSL2/STPROC/OBJ_CALIB_LIST.txt | 178 ++++++++++++++++----------------- 1 file changed, 88 insertions(+), 90 deletions(-) diff --git a/LSL2/STPROC/OBJ_CALIB_LIST.txt b/LSL2/STPROC/OBJ_CALIB_LIST.txt index 4db4f4f..51833f4 100644 --- a/LSL2/STPROC/OBJ_CALIB_LIST.txt +++ b/LSL2/STPROC/OBJ_CALIB_LIST.txt @@ -58,105 +58,103 @@ RETURN Result SendReminders: * * * * * * * -OPEN 'CALIB_LIST' TO FileIn ELSE - ErrorMsg = 'Unable to open "CALIB_LIST" table. (':Method:')' - RETURN -END - -CheckDt = OCONV(Date()+15,'D4/') -SelectSent = 'SELECT CALIB_LIST WITH NEXT_CAL_DT < ':QUOTE(CheckDt):' BY NEXT_CAL_DT' -RList(SelectSent,TARGET_ACTIVELIST$,'','','') - -NoteText = '' -Depts = '' - -Done = 0 -LOOP - READNEXT CLNo ELSE Done = 1 -UNTIL Done - READ CLRec FROM FileIn,CLNo THEN - - NextCalDt = OCONV(XLATE('CALIB_LIST',CLNo,'NEXT_CAL_DT','X'),'D4/') - - IF NextCalDt NE '' THEN - - CLType = CLRec - Dept = CLRec - IF Dept = '' THEN Dept = 'MET' - - IF CLType = 'E' THEN - Desc = CLRec - SN = CLRec - Loc = CLRec - SN = CLRec - Loc = CLRec - NewLine = 'The NIST Standard ':Desc:' (S/N: ':SN:') located in the ':Loc:' is due for calibration on ':NextCalDt:CRLF$ - END - - LOCATE Dept IN Depts USING @FM SETTING Pos ELSE - Depts = INSERT(Depts,Pos,0,0,Dept) - END - NoteText = NoteText:NewLine - - END ;* End of check for NextCalDt - END ;* End of CLRec read -REPEAT - -DeptUsers = '' -DeptDescs ='' - -PopupLiteral = XLATE('SYSREPOSPOPUPS',@APPID<1>:'**DEPT',PDISPLAY$,'X') - -CONVERT @VM:@SVM TO @FM:@VM IN PopupLiteral - -LiteralCnt = COUNT(PopupLiteral,@FM) + (PopupLiteral NE '') - -FOR I = 1 TO LiteralCnt - Dept = PopupLiteral - DeptDesc = PopupLiteral - UserNames = PopupLiteral - LOCATE Dept IN Depts USING @FM SETTING Pos THEN - CONVERT ' ' TO '' IN UserNames - CONVERT ',' TO @VM IN UserNames - DeptUsers = UserNames - DeptDescs = DeptDesc + OPEN 'CALIB_LIST' TO FileIn ELSE + ErrorMsg = 'Unable to open "CALIB_LIST" table. (':Method:')' + RETURN END -NEXT I -NoteSubject = "Equipment Calibration Reminder" + CheckDt = OCONV(Date()+15,'D4/') + SelectSent = 'SELECT CALIB_LIST WITH NEXT_CAL_DT < ':QUOTE(CheckDt):' AND WITH EQ_LOC NE "Out of Service" BY NEXT_CAL_DT' + RList(SelectSent,TARGET_ACTIVELIST$,'','','') -DeptCnt = COUNT(Depts,@FM) + (Depts NE '') + NoteText = '' + Depts = '' -FOR I = 1 TO DeptCnt - - IF NoteText NE '' THEN - *NoteText = 'Testing during development of new functionality - disregard':CRLF$:NoteText + Done = 0 + LOOP + READNEXT CLNo ELSE Done = 1 + UNTIL Done + READ CLRec FROM FileIn,CLNo THEN - Recipients = DeptUsers - - LOCATE @USER4 IN Recipients SETTING Dummy THEN - Recipient = @USER4 - - SentFrom = 'System' - Subject = DeptDescs:" Department - Equipment Calibration Reminder" - Message = NoteText - AttachWindow = 'MASTER_CALIB_LIST' - AttachKeys = '' - SendToGroup = '' + NextCalDt = OCONV(XLATE('CALIB_LIST',CLNo,'NEXT_CAL_DT','X'),'D4/') + + IF NextCalDt NE '' THEN + + CLType = CLRec + Dept = CLRec + IF Dept = '' THEN Dept = 'MET' - Obj_Notes('Create',Recipient:@RM:'System':@RM:NoteSubject:@RM:NoteText:@RM:'MASTER_CALIB_LIST') - + IF CLType = 'E' THEN + Desc = CLRec + SN = CLRec + Loc = CLRec + SN = CLRec + Loc = CLRec + NewLine = 'The NIST Standard ':Desc:' (S/N: ':SN:') located in the ':Loc:' is due for calibration on ':NextCalDt:CRLF$ + END + + LOCATE Dept IN Depts USING @FM SETTING Pos ELSE + Depts = INSERT(Depts,Pos,0,0,Dept) + END + NoteText = NoteText:NewLine + + END ;* End of check for NextCalDt + END ;* End of CLRec read + REPEAT + + DeptUsers = '' + DeptDescs ='' + + PopupLiteral = XLATE('SYSREPOSPOPUPS',@APPID<1>:'**DEPT',PDISPLAY$,'X') + + CONVERT @VM:@SVM TO @FM:@VM IN PopupLiteral + + LiteralCnt = COUNT(PopupLiteral,@FM) + (PopupLiteral NE '') + + FOR I = 1 TO LiteralCnt + Dept = PopupLiteral + DeptDesc = PopupLiteral + UserNames = PopupLiteral + LOCATE Dept IN Depts USING @FM SETTING Pos THEN + CONVERT ' ' TO '' IN UserNames + CONVERT ',' TO @VM IN UserNames + DeptUsers = UserNames + DeptDescs = DeptDesc END - - END + NEXT I -NEXT I + NoteSubject = "Equipment Calibration Reminder" + DeptCnt = COUNT(Depts,@FM) + (Depts NE '') + + FOR I = 1 TO DeptCnt + + IF NoteText NE '' THEN + *NoteText = 'Testing during development of new functionality - disregard':CRLF$:NoteText + + Recipients = DeptUsers + + LOCATE @USER4 IN Recipients SETTING Dummy THEN + Recipient = @USER4 + + SentFrom = 'System' + Subject = DeptDescs:" Department - Equipment Calibration Reminder" + Message = NoteText + AttachWindow = 'MASTER_CALIB_LIST' + AttachKeys = '' + SendToGroup = '' + + Obj_Notes('Create',Recipient:@RM:'System':@RM:NoteSubject:@RM:NoteText:@RM:'MASTER_CALIB_LIST') + + END + + END + + NEXT I RETURN -