Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRSXP43

PRSXP43.m

Go to the documentation of this file.
  1. PRSXP43 ;WCIOFO/JAH-POST INIT FOR PATCH 43 OT WARNINGS--8/18/98
  1. ;;4.0;PAID;**43**;Sep 21, 1995
  1. ;PAID
  1. ; Post install loops thru the pay period (pp) file (458) & looks for
  1. ; situations where an overtime warning should appear on the Pay Period
  1. ; Exceptions report. If such condition occurs, warning is filed in the
  1. ; file 458.6 (OVERTIME WARNINGS)--new with patch 43 & used to maintain
  1. ; status of overtime warnings. Payroll may later clear warnings
  1. ; thru the new option Overtime Warnings.
  1. Q
  1. ;
  1. SERCH4OT ;
  1. N PPSTART,XPDIDTOT,PPI,PPE,PRSDIV,PRSPCT,DFN,OTFLCNT
  1. S PPSTART="1998-11",OTFLCNT=0
  1. ;quit if patch installed already
  1. I $$PATCH^XPDUTL("PRS*4.0*43") D MES^XPDUTL(" OT Warning search skipped. Checked on earlier PRS*4*43 install") Q
  1. ;
  1. ; update installer of patch with messages about post-install.
  1. ;
  1. S PPSTART=$O(^PRST(458,"AB",PPSTART))
  1. Q:$G(PPSTART)'>0
  1. S PPI=$O(^PRST(458,"AB",PPSTART,0))
  1. Q:$G(PPI)'>0
  1. ;
  1. D MES^XPDUTL(" This process may take several minutes.")
  1. D MES^XPDUTL(" Estimating # of records to check for overtime (OT) warnings.")
  1. S XPDIDTOT=$$TOTAL(PPSTART)
  1. S PRSDIV=XPDIDTOT\50 I 'PRSDIV S PRSDIV=1
  1. S PRSPCT=0
  1. ;
  1. D MES^XPDUTL(" OT check--TT8B string vs. request--pay period "_PPSTART_" to present.")
  1. ;
  1. ; back up PPI to include records from current PPI in loop
  1. S PPI=PPI-.1
  1. F S PPI=$O(^PRST(458,PPI)) Q:PPI'>0 D
  1. .S PPE=$P($G(^PRST(458,PPI,0)),"^")
  1. .S DFN=0
  1. .F S DFN=$O(^PRST(458,PPI,"E",DFN)) Q:DFN'>0 D
  1. .. S PRSPCT=PRSPCT+1 ; # records processed
  1. ..; call to KIDS to update %complete bar at bottom of install screen.
  1. .. I '(PRSPCT#PRSDIV),(PRSPCT<XPDIDTOT) D UPDATE^XPDID(PRSPCT)
  1. ..;
  1. .. Q:'$D(^PRST(458,PPI,"E",DFN,"D",0))
  1. ..;
  1. ..; If timecard does not have a status of (T)imekeeper.
  1. ..; and there is a TT8b string on file.
  1. ..; Compare OT that's been calculated in the
  1. ..; TT8B to that which is approved in the request file.
  1. ..;
  1. .. N TT8B,STATUS,WEEK,OT8B,OTAPP
  1. .. S TT8B=$G(^PRST(458,PPI,"E",DFN,5)),STATUS=$P($G(^(0)),"^",2)
  1. .. Q:(STATUS="T")!(TT8B="")
  1. .. F WEEK=1:1:2 D
  1. ... D GETOTS^PRSAOTT(PPE,DFN,TT8B,WEEK,.OT8B,.OTAPP)
  1. ... I OTAPP<OT8B D
  1. .... D FILEOTW^PRSAOTTF(PPI,DFN,WEEK,OT8B,OTAPP)
  1. .... S OTFLCNT=OTFLCNT+1
  1. D UPDATE^XPDID(XPDIDTOT)
  1. D MES^XPDUTL(" "_OTFLCNT_" overtime warnings filed in 458.6")
  1. D MES^XPDUTL(" Please delete routine PRSXP43 when installation is complete.")
  1. Q
  1. TOTAL(PPE4Y) ;ESTIMATE TOTAL RECORDS TO EXAM DURING POST INIT
  1. ; Get # of records for 1 pay period (pp) & multiply by # of pps on
  1. ; file from pp passed in. This total estimates records to
  1. ; process during post-install & is used to update KIDS % complete bar.
  1. ; INPUT: pp in 4 digit year format
  1. ; LOCAL: PPS = # pps from PPE4Y to present
  1. ; PPE = pp external. PPI = pp ien. DFN = timecard ien
  1. ; OUTPUT: TOT = estimated timecards from pp passed (PPE4Y)- present
  1. ;
  1. S TOT=0
  1. N PPS,PPE,PPI,DFN
  1. S PPS=1,PPE=PPE4Y
  1. F S PPE=$O(^PRST(458,"AB",PPE)) Q:PPE'>0 S PPS=PPS+1
  1. S PPI=$O(^PRST(458,"AB",PPE4Y,0))
  1. ;
  1. Q:$G(PPI)'>0 TOT
  1. S TOT=$P($G(^PRST(458,PPI,"E",0)),"^",4)
  1. I TOT'>0 D
  1. . S DFN=0 F S DFN=$O(^PRST(458,PPI,"E",DFN)) Q:DFN'>0 S TOT=TOT+1
  1. S TOT=TOT*PPS
  1. Q TOT
  1. ;