source: WorldVistAEHR/trunk/r/PAID-PRS/PRSRL12.m@ 1739

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

initial load of WorldVistAEHR

File size: 4.7 KB
Line 
1PRSRL12 ;HISC/JH,WCIOFO/SAB-INDIVIDUAL EMPLOYEE LEAVE USED REPORT ;08/27/01
2 ;;4.0;PAID;**2,5,19,39,34,69**;Sep 21, 1995
3 ; prints leave used report when specific employee selected
4 N MLINHRS
5 S (PAGE,POUT)=0,DAT2=$$FMTE^XLFDT(DT)
6 D HDR3
7 D TYPSTF^PRSRUT0 ; returns SW(2): = 77 for daily tour, else = 73
8 S MLINHRS=$$MLINHRS^PRSAENT(DFN)
9 ; init totals for all leave types
10 F I=1:1 S X=$P($P(LVT,";",I+1),":") Q:X="" S TLEV(X)=""
11 ;
12 ; Add 2 types of leave to hold break out totals of
13 ; comp/credit--credit hours & compensatory.
14 ;
15 S (TLEV("CUCOMP"),TLEV("CUCRED"))=""
16 ; loop thru instances of wrk nodes containing leave
17 S INX=0 F S INX=$O(^TMP($J,"USE",INX)) Q:INX'>0 D Q:POUT
18 . ; loop thru pay periods (nn)
19 . S PP="" F S PP=$O(^TMP($J,"USE",INX,PP)) Q:PP="" D Q:POUT
20 .. ; loop thru leave date (fileman)
21 .. S DATE=0
22 .. F S DATE=$O(^TMP($J,"USE",INX,PP,DATE)) Q:DATE'>0 D Q:POUT
23 ... ; loop thru leave date (external)
24 ... S DAY=""
25 ... F S DAY=$O(^TMP($J,"USE",INX,PP,DATE,DAY)) Q:DAY="" D Q:POUT
26 .... S TOUR=$G(^TMP($J,"USE",INX,PP,DATE,DAY)) Q:TOUR=""
27 .... D:$Y+5>IOSL HDR Q:POUT
28 .... ; start detail line - only print pp and date when changed
29 .... W !,"|"
30 .... I PP'=PP(1) W PP S PP(1)=PP
31 .... W ?4,"|"
32 .... I DAY'=DAY(1) W DAY S DAY(1)=DAY
33 .... W ?19,"|"
34 .... S SW(3)=0 ; flag, set false to suppress new line when 1st segment
35 .... ; loop thru segments in node - data source and format from
36 .... ; node 2 for day, empl. in #458 but ONLY contains leave
37 .... F K=1:4 Q:$P(TOUR,"^",K+2)="" D
38 ..... N COMPCRED S LEV=$P(TOUR,"^",K+2) ; leave type (internal code)
39 ..... W:SW(3) !,"|",?4,"|",?19,"|" ; new line for subsequent segments
40 ..... S %=$F(LVT,";"_LEV_":")
41 ..... ;comp/credit (CU) is distinguishable by time remarks code (K+3)
42 ..... S:LEV="CU" COMPCRED=$S($P(TOUR,"^",K+3)=16:"Credit Hours",1:"Compensatory")
43 ..... ;display leave type
44 ..... W:%>0 $S(LEV="CU":COMPCRED,1:$P($E(LVT,%,999),";"))
45 ..... W:LEV="LWOP" " - AWOL"
46 ..... W ?41,"|",$P(TOUR,"^",K),?49,"|",$P(TOUR,"^",K+1),?57,"|"
47 ..... ; call PRSRLL to set TIM (elasped time) and TYL (D day, H hour)
48 ..... S Z="^^"_DATE_"^"_$P(TOUR,"^",K)_"^"_DATE_"^"_$P(TOUR,"^",K+1)
49 ..... I LEV="ML" D ; For Military Leave - PRS*4.0*69
50 ...... I MLINHRS D H^PRSRLL Q
51 ...... D D^PRSRLL
52 ..... D D^PRSRLL:LEV'="ML"&(SW(2)=77) ; daily tour
53 ..... D H^PRSRLL:LEV'="ML"&(SW(2)=73) ; else hour
54 ..... W ?57,$S(SW(2)=77:$J(TIM,4),1:$J(TIM,7,2))
55 ..... W " ",$S(TYL="H":"Hour",1:"Day")_$S(TIM="":"",TIM'=1:"s",1:"")
56 ..... W ?79,"|"
57 ..... S TLEV(LEV)=TLEV(LEV)+TIM ; add to total for type of leave
58 ..... I LEV="CU" S TLEV($S($P(TOUR,"^",K+3)=16:"CUCRED",1:"CUCOMP"))=TLEV($S($P(TOUR,"^",K+3)=16:"CUCRED",1:"CUCOMP"))+TIM
59 ..... S SW(3)=1 ; set flag true so next segment (if any) on new line
60 ;
61 I 'CNT D
62 . D VLIN0
63 . W !,"|",?10,"No Leave Usage on File within this Date Range.",?79,"|"
64 ;
65 ; report totals
66 I CNT,'POUT D
67 . D HDR:$Y+7>IOSL
68 . D VLIN0
69 . W !,"|",?4,"|",?19,"|",?27,"TOTALS:"
70 . S SW(3)=0 ; set false so 1st type of leave printed on same line
71 . ; loop thru leave type totals
72 . S LEV="" F S LEV=$O(TLEV(LEV)) Q:LEV="" D Q:POUT
73 .. Q:TLEV(LEV)="" ; none of this type of leave found
74 .. D:$Y+5>IOSL HDR Q:POUT
75 .. W:SW(3) !,"|",?4,"|",?19,"|",?39 ; new line when not first leave type
76 .. S %=$F(LVT,";"_LEV_":") W:%>0 ?39,$P($E(LVT,%,999),";") ; leave type
77 .. ;write out subtotals for comp/credit
78 .. I LEV="CUCOMP" W ?42,"Compensatory"
79 .. I LEV="CUCRED" W ?42,"Credit Hours"
80 .. W ?58,$S(SW(2)=77:$J($G(TLEV(LEV)),4),1:$J($G(TLEV(LEV)),7,2))
81 .. W " "
82 .. I LEV="ML" W $S(MLINHRS:"Hour",1:"Day")
83 .. I LEV'="ML" W $S(SW(2)=77:"Day",1:"Hour")
84 .. W $S(TLEV(LEV)'=1:"s",1:""),?79,"|"
85 .. S:'SW(3) SW(3)=1 ; set true so next leave type on new line
86 ;
87 ; report footer
88 I 'POUT D
89 . I IOSL<66 F I=$Y:1:IOSL-6 D VLIN0
90 . D VLIDSH0
91 . S CODE="L003",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT2^PRSRUT0
92 . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
93 ;
94 Q
95 ;
96HDR ; page break
97 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,POUT=1 Q
98 D VLIDSH0
99 S CODE="L003",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT2^PRSRUT0
100 I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR I 'Y S POUT=1 Q
101HDR3 ; page header
102 I $E(IOST,1,2)="C-"!PAGE W @IOF
103 S PAGE=PAGE+1
104 W !?31,^TMP($J,"USE"),?60,"DATE: ",DAT2
105 W !?22,"from: ",XX," to: ",YY
106 W !?24,"for: ",NAM," - T&L: ",TLE,!
107 D VLIDSH0
108 W !,"|","PP",?4,"|","DATE",?19,"|","TYPE",?41,"|","FROM",?49,"|","TO",?57,"|","LENGTH",?79,"|"
109 D VLIDSH0
110 S (PP(1),DAY(1))="" ; forces pp and leave date to print on new page
111 Q
112 ;
113VLIDSH0 ; dashed line (with columns)
114 W !,"|---|--------------|---------------------|-------|-------|---------------------|"
115 Q
116 ;
117VLIN0 ; blank line (with columns)
118 W !,"|",?4,"|",?19,"|",?41,"|",?49,"|",?57,"|",?79,"|"
119 Q
Note: See TracBrowser for help on using the repository browser.