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

PRSROT1.m

Go to the documentation of this file.
  1. PRSROT1 ;HISC/JH-IND. OR ALL EMPLOYEE OT/CT REPORT ;1/12/98
  1. ;;4.0;PAID;**2,19,21,28,27,34,114**;Sep 21, 1995;Build 6
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. SUP S PRSTLV=3,PRSAI=1
  1. S PRSR=1
  1. D TLESEL^PRSRUT0
  1. G Q:$G(TLE)=""!(SSN="")
  1. G EN1
  1. ;
  1. ;get Time & Leave unit and set up TLE array.
  1. FIS S PRSR=2,PRSTLV=7
  1. D TLESEL^PRSRUT0
  1. G Q:TLE=""!(SSN="")
  1. EN1 W ! S X="T",%DT="" D ^%DT Q:Y<0 S DT=Y K %DT
  1. ;
  1. ;get one or all employees
  1. EN2 W !
  1. S DIC="^PRSPC(",DIC(0)="AEQZ"
  1. S D="ATL"_$P(TLE(1),"^",1)
  1. S DIC("A")="Enter employee name (Return for All): "
  1. S DIC("S")="I $$INXR^PRSRL1($P(TLE(1),U),Y)"
  1. D IX^DIC G Q1:$D(DUOUT)!$D(DTOUT)
  1. S PRSRY=Y,SW=$S(PRSRY'=-1:0,1:1)
  1. I 'SW S D0=$P(PRSRY,"^") D CHKTLE^PRSRUTL G EN2:'STFSW
  1. ;
  1. ;get year and validate
  1. ASK S %DT("A")="Enter YEAR: "
  1. S %DT="AEP"
  1. S %DT(0)=-DT
  1. D ^%DT K %DT
  1. G Q1:$D(DTOUT)!(X="^"),MSG2:X="?"!(Y=-1)
  1. G MSG3:$P($O(^PRST(459,"B",$E(Y,2,3)_"-")),"-")'=$E(Y,2,3)
  1. S YEAR=$E(Y,2,3)
  1. ;
  1. ;get pay periods
  1. ASK1 ;
  1. ;determine first and last pay periods on file for year
  1. S X(1)=+$P($O(^PRST(459,"B",YEAR_"-00")),"-",2) ; first
  1. S X(2)=+$P($O(^PRST(459,"B",YEAR_"-99"),-1),"-",2) ;last
  1. S DIR(0)="NOA^"_X(1)_":"_X(2)_":0"
  1. S DIR("A")="Start with Pay Period ("_X(1)_"-"_X(2)_", or Return for all in this year): "
  1. S DIR("?",1)="Enter the number of the first pay period to be included"
  1. S DIR("?",2)="on the report. Only pay periods on file can be selected."
  1. S DIR("?",3)="Just press Return to select all pay periods for the year."
  1. S DIR("?",4)=" "
  1. S DIR("?")="Enter a number ("_X(1)_"-"_X(2)_") or press Return for all"
  1. D ^DIR K DIR G:$D(DTOUT)!$D(DUOUT) Q1
  1. I Y="" S PPE(1)=X(1),PPE(2)=X(2) ; all pay periods
  1. E S PPE(1)=Y D G:$D(DIRUT) Q1 S PPE(2)=Y
  1. . S DIR(0)="NA^"_PPE(1)_":"_X(2)_":0"
  1. . S DIR("A")="End with Pay Period ("_PPE(1)_"-"_X(2)_"): "
  1. . S DIR("B")=PPE(1)
  1. . D ^DIR K DIR
  1. S:$L(PPE(1))=1 PPE(1)="0"_PPE(1)
  1. S:$L(PPE(2))=1 PPE(2)="0"_PPE(2)
  1. I SW,PPE(1)'=PPE(2) W !,"This report could take some time. Consider Queuing the report."
  1. ;
  1. S TLUNIT=$S(PRSRDUZ:$P($G(^PRSPC(PRSRDUZ,0)),"^",7),1:$O(^VA(200,DUZ,2,0))),TLI=$S(PRSRDUZ:$P($G(^(0)),"^",8),1:"000")
  1. S ZTRTN="START^PRSROT1"
  1. S ZTDESC="EMPLOYEE OT/CT REPORT" W !!,$C(7),"THIS IS A 132 COLUMN REPORT !",! D ST^PRSRUTL,LOOP,QUE1^PRSRUT0 G Q1:POP!($D(ZTSK))
  1. ;
  1. ;======================================================================
  1. ;
  1. START S (CNT,COMP(1),COMPU(1),OTP(1),OTH(1),POUT)=0
  1. K ^TMP($J)
  1. S ^TMP($J,"OT/CP")="EMPLOYEE OT/CT REPORT"
  1. ;
  1. ; loop thru specified pay periods and gather/sort data
  1. S PPE=+PPE(1)-1 S:$L(PPE)=1 PPE="0"_PPE
  1. S DA(2)=YEAR_"-"_PPE
  1. F S DA(2)=$O(^PRST(459,"B",DA(2))) Q:($P(DA(2),"-")'=YEAR)!($P(DA(2),"-",2)>PPE(2)) D
  1. . S DA(1)=$O(^PRST(459,"B",DA(2),0)) Q:DA(1)'>0 ; pay period ien in 459
  1. . D DAT ; payrun date
  1. . S DA(3)=$O(^PRST(458,"B",DA(2),0)) Q:DA(3)'>0 ; pay period ien in 458
  1. . ; if one employee
  1. . I 'SW D OTCT^PRSROSOR
  1. . ; if all employees
  1. . I SW S D0=0 F S D0=$O(^PRST(458,DA(3),"E",D0)) Q:D0'>0 D
  1. . . S NAM=$P($G(^PRSPC(D0,0)),"^")
  1. . . D OTCT^PRSROSOR
  1. ;
  1. ; report results
  1. IND S DAT=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3) U IO I 'CNT D HDR1^PRSROT11 W !,"|",?10,"No Overtime, Comptime, or Credit Hours Data on File.",?131,"|" S POUT=1 D NONE G Q1
  1. D ^PRSROT11 G Q1:POUT I CNT D VLIDSH0^PRSROT11 S CODE="O001",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT1^PRSRUT0
  1. Q I $E(IOST,1,2)="C-" S DIR(0)="E",DIR("A")="Press RETURN to continue" D ^DIR K DIR
  1. Q1 K %,%DT,DATT,DIC,FOOT,INX,CODE,COMP,COMPU,DTOUT,DUOUT,POP,OTH,OTP,PPE,PRSAI,PRSR,PRSRY,PRSTLV,TL,TLE,TLI,USR,TLUNIT,CNT,COS,COSORG,D0,DA,DAT,DATE,DATES,DAY,DDATE,PP
  1. K I,II,NAM,ORG,POUT,SAL,SSN,STFSW,SW,TIME,TITLE,X,Y,YEAR,Z1,ZTDESC,ZTRTN,ZTSAVE,ZTSK,^TMP($J) D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. DAT S DATE=$P($G(^PRST(459,DA(1),0)),"^",2) S:DATE'="" DATE=$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)
  1. Q
  1. NONE I IOSL<66 D VLIN0^PRSROT11
  1. D HDR^PRSROT11
  1. Q
  1. MSG2 W $C(7),!!,"*** Enter Year: 92 , 1994 ... " G ASK
  1. MSG3 W $C(7),!!,"*** Year Entered is not on File." G ASK
  1. LOOP F X="D0","DA*","PPE*","NAM","TLE*","TL*","TLI","TLUNIT","SW","COS","ORG","YEAR","PRSRY","PRSTLV" S ZTSAVE(X)=""
  1. Q