source: WorldVistAEHR/trunk/r/PAID-PRS/PRSRL11.m@ 691

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

initial load of WorldVistAEHR

File size: 3.8 KB
RevLine 
[613]1PRSRL11 ;HISC/JH,WIRMFO/JAH,SAB-ALL EMPLOYEE LEAVE USED REPORT ;8/27/01
2 ;;4.0;PAID;**2,17,39,34,69**;Sep 21, 1995
3 ; prints leave used report when All employees in T&L Unit selected
4 S (PAGE,POUT)=0,DAT2=$$FMTE^XLFDT(DT)
5 D HDR1
6 N MLINHRS
7 ; loop thru pay periods (external value)
8 S PP=""
9 F S PP=$O(^TMP($J,"USE",PP)) Q:PP="" D Q:POUT
10 . S DATE(1)="" ; previous leave date, used to control printing of date
11 . ; loop thru leave dates (fileman)
12 . S DATE=0 F S DATE=$O(^TMP($J,"USE",PP,DATE)) Q:DATE'>0 D Q:POUT
13 .. S DATE(2)=$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)
14 .. ; loop thru employee names
15 .. S NAM="" F S NAM=$O(^TMP($J,"USE",PP,DATE,NAM)) Q:NAM="" D Q:POUT
16 ... ; loop thru employee ssn's
17 ... S SSN=""
18 ... F S SSN=$O(^TMP($J,"USE",PP,DATE,NAM,SSN)) Q:SSN="" D Q:POUT
19 .... ; loop thru employee ien's (file #450)
20 .... S D0=0
21 .... F S D0=$O(^TMP($J,"USE",PP,DATE,NAM,SSN,D0)) Q:D0'>0 D Q:POUT
22 ..... ; loop thru instances of wrk nodes that contained leave
23 ..... S NUM=0
24 ..... F S NUM=$O(^TMP($J,"USE",PP,DATE,NAM,SSN,D0,NUM)) Q:NUM'>0 D Q:POUT
25 ...... S TOUR=$G(^TMP($J,"USE",PP,DATE,NAM,SSN,D0,NUM))
26 ...... Q:TOUR=""!($P(TOUR,U,3)="") ; no start time or type of time
27 ...... Q:$E($P(TOUR,U,3),1)="H" ; holiday worked or excused
28 ...... S PRSRSSN=$E(SSN,1,3)_$E(SSN,5,6)_$E(SSN,8,11)
29 ...... D TYPSTF^PRSRUT0 ; returns SW(2), = 77 for daily tour, else = 73
30 ...... S MLINHRS=$$MLINHRS^PRSAENT(DFN)
31 ...... D:$Y+5>IOSL HDR Q:POUT
32 ...... W !,"|"
33 ...... I DATE'=DATE(1) W DATE(2) S DATE(1)=DATE ; print date if changed
34 ...... W ?10,"|",$E(NAM,1,20),?32,"|"
35 ...... S SW(3)=0 ; flag, set false to suppress new line when 1st segment
36 ...... ; loop thru leave segments in node - data source and format from
37 ...... ; node 2 for day, empl. in #458 but ONLY contains leave
38 ...... ; Break out CU posting to comp or credit based on time remarks.
39 ...... ;
40 ...... F K=1:4 Q:$P(TOUR,"^",K+2)="" D
41 ....... N COMPCRED S LEV=$P(TOUR,"^",K+2),%=$F(LVT,";"_LEV_":")
42 ....... W:SW(3) !,"|",?10,"|",?32,"|" ; new line for subsequent segments
43 .......; W:%>0 $P($E(LVT,%,999),";")
44 ....... S:LEV="CU" COMPCRED=$S($P(TOUR,"^",K+3)=16:"Credit Hours",1:"Compensatory")
45 ....... W:%>0 $S(LEV="CU":COMPCRED,1:$P($E(LVT,%,999),";"))
46 ....... W ?53,"|",$P(TOUR,"^",K),?61,"|",$P(TOUR,"^",K+1),?69,"|"
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
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 $S(SW(2)=77:$J(TIM,7),1:$J(TIM,7,2))
55 ....... W ?($X+1),TYL,?79,"|"
56 ....... S SW(3)=1 ; set flag true so next segment (if any) on new line
57 .. Q:POUT
58 .. D VLIN1
59 ;
60 I 'CNT D
61 . D VLIN1
62 . W !,"|",?10,"No Leave Usage on File within this Date Range.",?79,"|"
63 ;
64 ; report footer
65 I 'POUT D
66 . I $Y+5<IOSL,IOSL<66 F I=$Y:1:IOSL-5 D VLIN1
67 . D VLIDSH1
68 . S CODE="L004",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT2^PRSRUT0
69 . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
70 Q
71 ;
72HDR ; page break
73 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,POUT=1 Q
74 D VLIDSH1
75 S CODE="L004",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT2^PRSRUT0
76 I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR I 'Y S POUT=1 Q
77HDR1 ; page header
78 W:$E(IOST,1,2)="C-"!(PAGE) @IOF
79 S PAGE=PAGE+1
80 W !?31,^TMP($J,"USE"),?60,"DATE: ",DAT2
81 W !?22,"from: ",XX," to: ",YY
82 W !?36,"T&L: ",$P(TLE(1),"^"),!
83 D VLIDSH1
84 W !,"|","DATE",?10,"|","EMPLOYEE",?32,"|","TYPE",?53,"|","FROM",?61,"|","TO",?69,"|","LENGTH",?79,"|"
85 D VLIDSH1
86 S DATE(1)="" ; forces leave date to print on new page
87 Q
88 ;
89VLIDSH1 ;dashed line (with columns)
90 W !,"|---------|---------------------|--------------------|-------|-------|---------|"
91 Q
92 ;
93VLIN1 ; blank line (with columns)
94 W !,"|",?10,"|",?32,"|",?53,"|",?61,"|",?69,"|",?79,"|"
95 Q
Note: See TracBrowser for help on using the repository browser.