source: WorldVistAEHR/trunk/r/PAID-PRS/PRSROT1.m@ 1396

Last change on this file since 1396 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1PRSROT1 ;HISC/JH-IND. OR ALL EMPLOYEE OT/CT REPORT ;1/12/98
2 ;;4.0;PAID;**2,19,21,28,27,34,114**;Sep 21, 1995;Build 6
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5SUP S PRSTLV=3,PRSAI=1
6 S PRSR=1
7 D TLESEL^PRSRUT0
8 G Q:$G(TLE)=""!(SSN="")
9 G EN1
10 ;
11 ;get Time & Leave unit and set up TLE array.
12FIS S PRSR=2,PRSTLV=7
13 D TLESEL^PRSRUT0
14 G Q:TLE=""!(SSN="")
15EN1 W ! S X="T",%DT="" D ^%DT Q:Y<0 S DT=Y K %DT
16 ;
17 ;get one or all employees
18EN2 W !
19 S DIC="^PRSPC(",DIC(0)="AEQZ"
20 S D="ATL"_$P(TLE(1),"^",1)
21 S DIC("A")="Enter employee name (Return for All): "
22 S DIC("S")="I $$INXR^PRSRL1($P(TLE(1),U),Y)"
23 D IX^DIC G Q1:$D(DUOUT)!$D(DTOUT)
24 S PRSRY=Y,SW=$S(PRSRY'=-1:0,1:1)
25 I 'SW S D0=$P(PRSRY,"^") D CHKTLE^PRSRUTL G EN2:'STFSW
26 ;
27 ;get year and validate
28ASK S %DT("A")="Enter YEAR: "
29 S %DT="AEP"
30 S %DT(0)=-DT
31 D ^%DT K %DT
32 G Q1:$D(DTOUT)!(X="^"),MSG2:X="?"!(Y=-1)
33 G MSG3:$P($O(^PRST(459,"B",$E(Y,2,3)_"-")),"-")'=$E(Y,2,3)
34 S YEAR=$E(Y,2,3)
35 ;
36 ;get pay periods
37ASK1 ;
38 ;determine first and last pay periods on file for year
39 S X(1)=+$P($O(^PRST(459,"B",YEAR_"-00")),"-",2) ; first
40 S X(2)=+$P($O(^PRST(459,"B",YEAR_"-99"),-1),"-",2) ;last
41 S DIR(0)="NOA^"_X(1)_":"_X(2)_":0"
42 S DIR("A")="Start with Pay Period ("_X(1)_"-"_X(2)_", or Return for all in this year): "
43 S DIR("?",1)="Enter the number of the first pay period to be included"
44 S DIR("?",2)="on the report. Only pay periods on file can be selected."
45 S DIR("?",3)="Just press Return to select all pay periods for the year."
46 S DIR("?",4)=" "
47 S DIR("?")="Enter a number ("_X(1)_"-"_X(2)_") or press Return for all"
48 D ^DIR K DIR G:$D(DTOUT)!$D(DUOUT) Q1
49 I Y="" S PPE(1)=X(1),PPE(2)=X(2) ; all pay periods
50 E S PPE(1)=Y D G:$D(DIRUT) Q1 S PPE(2)=Y
51 . S DIR(0)="NA^"_PPE(1)_":"_X(2)_":0"
52 . S DIR("A")="End with Pay Period ("_PPE(1)_"-"_X(2)_"): "
53 . S DIR("B")=PPE(1)
54 . D ^DIR K DIR
55 S:$L(PPE(1))=1 PPE(1)="0"_PPE(1)
56 S:$L(PPE(2))=1 PPE(2)="0"_PPE(2)
57 I SW,PPE(1)'=PPE(2) W !,"This report could take some time. Consider Queuing the report."
58 ;
59 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")
60 S ZTRTN="START^PRSROT1"
61 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))
62 ;
63 ;======================================================================
64 ;
65START S (CNT,COMP(1),COMPU(1),OTP(1),OTH(1),POUT)=0
66 K ^TMP($J)
67 S ^TMP($J,"OT/CP")="EMPLOYEE OT/CT REPORT"
68 ;
69 ; loop thru specified pay periods and gather/sort data
70 S PPE=+PPE(1)-1 S:$L(PPE)=1 PPE="0"_PPE
71 S DA(2)=YEAR_"-"_PPE
72 F S DA(2)=$O(^PRST(459,"B",DA(2))) Q:($P(DA(2),"-")'=YEAR)!($P(DA(2),"-",2)>PPE(2)) D
73 . S DA(1)=$O(^PRST(459,"B",DA(2),0)) Q:DA(1)'>0 ; pay period ien in 459
74 . D DAT ; payrun date
75 . S DA(3)=$O(^PRST(458,"B",DA(2),0)) Q:DA(3)'>0 ; pay period ien in 458
76 . ; if one employee
77 . I 'SW D OTCT^PRSROSOR
78 . ; if all employees
79 . I SW S D0=0 F S D0=$O(^PRST(458,DA(3),"E",D0)) Q:D0'>0 D
80 . . S NAM=$P($G(^PRSPC(D0,0)),"^")
81 . . D OTCT^PRSROSOR
82 ;
83 ; report results
84IND 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
85 D ^PRSROT11 G Q1:POUT I CNT D VLIDSH0^PRSROT11 S CODE="O001",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT1^PRSRUT0
86Q I $E(IOST,1,2)="C-" S DIR(0)="E",DIR("A")="Press RETURN to continue" D ^DIR K DIR
87Q1 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
88 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="@"
89 Q
90DAT 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)
91 Q
92NONE I IOSL<66 D VLIN0^PRSROT11
93 D HDR^PRSROT11
94 Q
95MSG2 W $C(7),!!,"*** Enter Year: 92 , 1994 ... " G ASK
96MSG3 W $C(7),!!,"*** Year Entered is not on File." G ASK
97LOOP F X="D0","DA*","PPE*","NAM","TLE*","TL*","TLI","TLUNIT","SW","COS","ORG","YEAR","PRSRY","PRSTLV" S ZTSAVE(X)=""
98 Q
Note: See TracBrowser for help on using the repository browser.