PRSXP43 ;WCIOFO/JAH-POST INIT FOR PATCH 43 OT WARNINGS--8/18/98
;;4.0;PAID;**43**;Sep 21, 1995
;PAID
; Post install loops thru the pay period (pp) file (458) & looks for
; situations where an overtime warning should appear on the Pay Period
; Exceptions report. If such condition occurs, warning is filed in the
; file 458.6 (OVERTIME WARNINGS)--new with patch 43 & used to maintain
; status of overtime warnings. Payroll may later clear warnings
; thru the new option Overtime Warnings.
Q
;
SERCH4OT ;
N PPSTART,XPDIDTOT,PPI,PPE,PRSDIV,PRSPCT,DFN,OTFLCNT
S PPSTART="1998-11",OTFLCNT=0
;quit if patch installed already
I $$PATCH^XPDUTL("PRS*4.0*43") D MES^XPDUTL(" OT Warning search skipped. Checked on earlier PRS*4*43 install") Q
;
; update installer of patch with messages about post-install.
;
S PPSTART=$O(^PRST(458,"AB",PPSTART))
Q:$G(PPSTART)'>0
S PPI=$O(^PRST(458,"AB",PPSTART,0))
Q:$G(PPI)'>0
;
D MES^XPDUTL(" This process may take several minutes.")
D MES^XPDUTL(" Estimating # of records to check for overtime (OT) warnings.")
S XPDIDTOT=$$TOTAL(PPSTART)
S PRSDIV=XPDIDTOT\50 I 'PRSDIV S PRSDIV=1
S PRSPCT=0
;
D MES^XPDUTL(" OT check--TT8B string vs. request--pay period "_PPSTART_" to present.")
;
; back up PPI to include records from current PPI in loop
S PPI=PPI-.1
F S PPI=$O(^PRST(458,PPI)) Q:PPI'>0 D
.S PPE=$P($G(^PRST(458,PPI,0)),"^")
.S DFN=0
.F S DFN=$O(^PRST(458,PPI,"E",DFN)) Q:DFN'>0 D
.. S PRSPCT=PRSPCT+1 ; # records processed
..; call to KIDS to update %complete bar at bottom of install screen.
.. I '(PRSPCT#PRSDIV),(PRSPCT<XPDIDTOT) D UPDATE^XPDID(PRSPCT)
..;
.. Q:'$D(^PRST(458,PPI,"E",DFN,"D",0))
..;
..; If timecard does not have a status of (T)imekeeper.
..; and there is a TT8b string on file.
..; Compare OT that's been calculated in the
..; TT8B to that which is approved in the request file.
..;
.. N TT8B,STATUS,WEEK,OT8B,OTAPP
.. S TT8B=$G(^PRST(458,PPI,"E",DFN,5)),STATUS=$P($G(^(0)),"^",2)
.. Q:(STATUS="T")!(TT8B="")
.. F WEEK=1:1:2 D
... D GETOTS^PRSAOTT(PPE,DFN,TT8B,WEEK,.OT8B,.OTAPP)
... I OTAPP<OT8B D
.... D FILEOTW^PRSAOTTF(PPI,DFN,WEEK,OT8B,OTAPP)
.... S OTFLCNT=OTFLCNT+1
D UPDATE^XPDID(XPDIDTOT)
D MES^XPDUTL(" "_OTFLCNT_" overtime warnings filed in 458.6")
D MES^XPDUTL(" Please delete routine PRSXP43 when installation is complete.")
Q
TOTAL(PPE4Y) ;ESTIMATE TOTAL RECORDS TO EXAM DURING POST INIT
; Get # of records for 1 pay period (pp) & multiply by # of pps on
; file from pp passed in. This total estimates records to
; process during post-install & is used to update KIDS % complete bar.
; INPUT: pp in 4 digit year format
; LOCAL: PPS = # pps from PPE4Y to present
; PPE = pp external. PPI = pp ien. DFN = timecard ien
; OUTPUT: TOT = estimated timecards from pp passed (PPE4Y)- present
;
S TOT=0
N PPS,PPE,PPI,DFN
S PPS=1,PPE=PPE4Y
F S PPE=$O(^PRST(458,"AB",PPE)) Q:PPE'>0 S PPS=PPS+1
S PPI=$O(^PRST(458,"AB",PPE4Y,0))
;
Q:$G(PPI)'>0 TOT
S TOT=$P($G(^PRST(458,PPI,"E",0)),"^",4)
I TOT'>0 D
. S DFN=0 F S DFN=$O(^PRST(458,PPI,"E",DFN)) Q:DFN'>0 S TOT=TOT+1
S TOT=TOT*PPS
Q TOT
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSXP43 3310 printed Dec 13, 2024@02:28:58 Page 2
PRSXP43 ;WCIOFO/JAH-POST INIT FOR PATCH 43 OT WARNINGS--8/18/98
+1 ;;4.0;PAID;**43**;Sep 21, 1995
+2 ;PAID
+3 ; Post install loops thru the pay period (pp) file (458) & looks for
+4 ; situations where an overtime warning should appear on the Pay Period
+5 ; Exceptions report. If such condition occurs, warning is filed in the
+6 ; file 458.6 (OVERTIME WARNINGS)--new with patch 43 & used to maintain
+7 ; status of overtime warnings. Payroll may later clear warnings
+8 ; thru the new option Overtime Warnings.
+9 QUIT
+10 ;
SERCH4OT ;
+1 NEW PPSTART,XPDIDTOT,PPI,PPE,PRSDIV,PRSPCT,DFN,OTFLCNT
+2 SET PPSTART="1998-11"
SET OTFLCNT=0
+3 ;quit if patch installed already
+4 IF $$PATCH^XPDUTL("PRS*4.0*43")
DO MES^XPDUTL(" OT Warning search skipped. Checked on earlier PRS*4*43 install")
QUIT
+5 ;
+6 ; update installer of patch with messages about post-install.
+7 ;
+8 SET PPSTART=$ORDER(^PRST(458,"AB",PPSTART))
+9 if $GET(PPSTART)'>0
QUIT
+10 SET PPI=$ORDER(^PRST(458,"AB",PPSTART,0))
+11 if $GET(PPI)'>0
QUIT
+12 ;
+13 DO MES^XPDUTL(" This process may take several minutes.")
+14 DO MES^XPDUTL(" Estimating # of records to check for overtime (OT) warnings.")
+15 SET XPDIDTOT=$$TOTAL(PPSTART)
+16 SET PRSDIV=XPDIDTOT\50
IF 'PRSDIV
SET PRSDIV=1
+17 SET PRSPCT=0
+18 ;
+19 DO MES^XPDUTL(" OT check--TT8B string vs. request--pay period "_PPSTART_" to present.")
+20 ;
+21 ; back up PPI to include records from current PPI in loop
+22 SET PPI=PPI-.1
+23 FOR
SET PPI=$ORDER(^PRST(458,PPI))
if PPI'>0
QUIT
Begin DoDot:1
+24 SET PPE=$PIECE($GET(^PRST(458,PPI,0)),"^")
+25 SET DFN=0
+26 FOR
SET DFN=$ORDER(^PRST(458,PPI,"E",DFN))
if DFN'>0
QUIT
Begin DoDot:2
+27 ; # records processed
SET PRSPCT=PRSPCT+1
+28 ; call to KIDS to update %complete bar at bottom of install screen.
+29 IF '(PRSPCT#PRSDIV)
IF (PRSPCT<XPDIDTOT)
DO UPDATE^XPDID(PRSPCT)
+30 ;
+31 if '$DATA(^PRST(458,PPI,"E",DFN,"D",0))
QUIT
+32 ;
+33 ; If timecard does not have a status of (T)imekeeper.
+34 ; and there is a TT8b string on file.
+35 ; Compare OT that's been calculated in the
+36 ; TT8B to that which is approved in the request file.
+37 ;
+38 NEW TT8B,STATUS,WEEK,OT8B,OTAPP
+39 SET TT8B=$GET(^PRST(458,PPI,"E",DFN,5))
SET STATUS=$PIECE($GET(^(0)),"^",2)
+40 if (STATUS="T")!(TT8B="")
QUIT
+41 FOR WEEK=1:1:2
Begin DoDot:3
+42 DO GETOTS^PRSAOTT(PPE,DFN,TT8B,WEEK,.OT8B,.OTAPP)
+43 IF OTAPP<OT8B
Begin DoDot:4
+44 DO FILEOTW^PRSAOTTF(PPI,DFN,WEEK,OT8B,OTAPP)
+45 SET OTFLCNT=OTFLCNT+1
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+46 DO UPDATE^XPDID(XPDIDTOT)
+47 DO MES^XPDUTL(" "_OTFLCNT_" overtime warnings filed in 458.6")
+48 DO MES^XPDUTL(" Please delete routine PRSXP43 when installation is complete.")
+49 QUIT
TOTAL(PPE4Y) ;ESTIMATE TOTAL RECORDS TO EXAM DURING POST INIT
+1 ; Get # of records for 1 pay period (pp) & multiply by # of pps on
+2 ; file from pp passed in. This total estimates records to
+3 ; process during post-install & is used to update KIDS % complete bar.
+4 ; INPUT: pp in 4 digit year format
+5 ; LOCAL: PPS = # pps from PPE4Y to present
+6 ; PPE = pp external. PPI = pp ien. DFN = timecard ien
+7 ; OUTPUT: TOT = estimated timecards from pp passed (PPE4Y)- present
+8 ;
+9 SET TOT=0
+10 NEW PPS,PPE,PPI,DFN
+11 SET PPS=1
SET PPE=PPE4Y
+12 FOR
SET PPE=$ORDER(^PRST(458,"AB",PPE))
if PPE'>0
QUIT
SET PPS=PPS+1
+13 SET PPI=$ORDER(^PRST(458,"AB",PPE4Y,0))
+14 ;
+15 if $GET(PPI)'>0
QUIT TOT
+16 SET TOT=$PIECE($GET(^PRST(458,PPI,"E",0)),"^",4)
+17 IF TOT'>0
Begin DoDot:1
+18 SET DFN=0
FOR
SET DFN=$ORDER(^PRST(458,PPI,"E",DFN))
if DFN'>0
QUIT
SET TOT=TOT+1
End DoDot:1
+19 SET TOT=TOT*PPS
+20 QUIT TOT
+21 ;