source: FOIAVistA/trunk/r/PAID-PRS/PRSRL41.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1PRSRL41 ;HISC/JH-INDIVIDUAL EMPLOYEE LEAVE USAGE PATTERN (Continued) ;09/24/01
2 ;;4.0;PAID;**2,19,21,35,69**;Sep 21, 1995
3 S ORG=$E(ORG,1,12)
4 D HDR1
5 S (PP(1),DAY(1),DATT(1))=""
6 S DATE(1)=0
7 ;
8 ;initialize leave arrays, subscripted by ("AL","SL","ML","WP"...)
9 F I=1:1 S X=$P($P(LVT,";",I+1),":") Q:X="" S LEV(X)="",TLEV(X)=""
10 D TYPSTF^PRSRUT0
11 S INX=0
12 ;
13 ;Loop through LEAVE pattern temp global.
14 ;
15 ;debug line
16 ;W !!,"LEAVE PATTERN TEMP GLOBAL: "," ^TMP(",$J,",USE," Q
17 F I=0:0 S INX=$O(^TMP($J,"USE",INX)) Q:INX'>0 D Q:POUT
18 .;
19 .; Loop through each pay period.
20 . S PP=""
21 . F I=0:0 S PP=$O(^TMP($J,"USE",INX,PP)) Q:PP="" S SW(1)=0 D Q:POUT
22 ..;
23 ..; Loop through the dates within the pay period.
24 .. S DATE=0
25 .. F I=0:0 S DATE=$O(^TMP($J,"USE",INX,PP,DATE)) Q:DATE'>0 D Q:POUT
26 ...;
27 ...; Loop through days of week (even though only one per loop)
28 ... S DAY=""
29 ... F I=0:0 S DAY=$O(^TMP($J,"USE",INX,PP,DATE,DAY)) Q:DAY="" S TOUR=$G(^(DAY)) Q:TOUR="" S SW(3)=0 D Q:POUT
30 ....;
31 .... D:($Y>(IOSL-5)) HDR Q:POUT
32 .... S DATT=$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)
33 .... D CHK,VLIN0:X>1
34 .... W !,"|"
35 .... W $S(PP'=PP(1):$E(PP,3,7),1:"")
36 .... W ?7,"|",DAY,?12,"|"
37 .... W $S(DATT'=DATT(1):DATT,1:""),?22,"|" D
38 ..... D:TOUR["DO" DAY
39 ..... I TOUR'["DO" F K=1:4 Q:$P(TOUR,"^",K+2)="" S LEV=$P(TOUR,"^",K+2),%=$F(LVT,";"_LEV_":") W:SW(3) !,"|",?7,"|",?12,"|",?22,"|" D
40 ...... W:%>0 ?23,LEV
41 ...... W ?27,"|",$P(TOUR,"^",K)
42 ...... W ?35,"|",$P(TOUR,"^",K+1)
43 ...... W ?43,"|"
44 ...... S Z="^^"_DATE_"^"_$P(TOUR,"^",K)_"^"_DATE_"^"_$P(TOUR,"^",K+1) D
45 ....... S COM=$G(^TMP($J,"US",INX))
46 ....... D D^PRSRLL:$P($E(LVT,%,999),";")="ML"!(SW(2)=77),H^PRSRLL:$P($E(LVT,%,999),";")'="ML"&(SW(2)=73) W $S(SW(2)=77:$J(TIM,6),1:$J(TIM,6,2)),?($X+1),TYL,?52,"|",$S($D(COM):$E(COM,1,26),1:""),?79,"|" D
47 ........ S LEV(LEV)=LEV(LEV)+TIM,TLEV(LEV)=TLEV(LEV)+TIM S SW(1)=SW(1)+1,SW(3)=1
48 ........ Q
49 ....... Q
50 ...... Q
51 ..... S PP(1)=PP,DATT(1)=DATT,DAY(1)=DAY,DATE(1)=DATE Q
52 .... Q
53 ... Q
54 .. Q
55 . Q
56 ;
57 ; Print Totals
58 ;
59 Q:POUT
60 D:$Y>(IOSL-7) VLIN0,HDR Q:POUT
61 I SW(1) D VLIN0 W !,"|",?7,"|",?12,"|",?15,"TOTALS:" S (SW(3),TLEV)=0,X="" D
62 . F I=0:0 S X=$O(TLEV(X)) Q:X="" D:$Y>(IOSL-5) HDR Q:POUT S %=$F(LVT,";"_X_":") W:SW(3)&(TLEV(X)'="") !,"|",?7,"|",?12,"|",?22,"|" S TLEV=TLEV+TLEV(X) D
63 .. W:TLEV(X)'="" ?24,$P($E(LVT,%,999),";"),?44,$S(SW(2)=77:$J($G(TLEV(X)),6),1:$J($G(TLEV(X)),6,2)),?($X+1),TYL,?52,"|",?79,"|" S:'SW(3)&(TLEV(X)'="") SW(3)=1
64 .. Q
65 . Q
66 I IOSL<66 F I=$Y:1:IOSL-6 D VLIN0
67 Q
68CHK S X1=DATE,X2=DATE(1) D ^%DTC Q
69DAY W TOUR,?27,"|",?35,"|",?43,"|",?52,"|",?79,"|" S SW(1)=SW(1)+1 Q
70HDR S CODE="L005",FOOT="VA TIME & ATTENDANCE SYSTEM" D VLIDSH0,FOOT2^PRSRUT0
71 I $E(IOST)="C"!($G(IOT)="VTRM") R !,"Press Return/Enter to continue. ",II:DTIME S:II="^" POUT=1 Q:POUT
72 Q:POUT
73HDR1 ; Main header for report contains:
74 ; Title, ALL/ONLY, date, date range, employee, cost center, T&L unit
75 ;
76 ; Subheader according to type of report user selected
77 S SUBHDR=$S(ALOO="A":"All Leave Taken With Days Off",1:"Every Occurance of Leave, ONLY Before And After Days Off")
78 W @IOF
79 W !?29,^TMP($J,"USE"),?66
80 W "DATE: ",DAT,!?22,"from: ",XX," to ",YY
81 W !,?(80-$L(SUBHDR))\2,SUBHDR ;tab depending on length of subheader
82 W !?25,"for: ",NAM," - "
83 W ORG,!,?33
84 W "T&L Unit: ",TLE
85 D VLIDSH0
86 W !,"|","P/P",?7,"|","DAY",?12,"|","DATE",?22,"|","TYPE",?27,"|","FROM",?35,"|","TO",?43,"|","LENGTH",?52,"|","COMMENT",?79,"|" D VLIDSH0 Q
87VLIDSH0 W !,"|------|----|---------|----|-------|-------|--------|--------------------------|" Q
88VLIN0 W !,"|",?7,"|",?12,"|",?22,"|",?27,"|",?35,"|",?43,"|",?52,"|",?79,"|" Q
89ASKDSPLY() ; Ask user if they want to see all leave, including days off and
90 ; Holidays or if they want to see only leave taken immediately
91 ; before or after Holidays and days off.
92 N DIR
93 S RTN=""
94 S DIR(0)="SM^A:All leave;O:Only around days off & holidays"
95 S DIR("A")=" Choose A or O "
96 S DIR("A",1)="You may display ALL leave taken within the date range"
97 S DIR("A",2)="or ONLY leave taken the day before and after holidays"
98 S DIR("A",3)="and scheduled days off."
99 S DIR("A",4)=""
100 S DIR("?",1)="If you select ONLY leave around days off and holidays,"
101 S DIR("?",2)="then for example, when an employee with weekends off has"
102 S DIR("?",3)="taken annual leave for the entire week (Mon-Fri), only"
103 S DIR("?",4)="the leave for Monday and Friday will be displayed."
104 S DIR("?")="Selecting ALL, will display all leave taken."
105 D ^DIR S RTN=Y
106 Q RTN
Note: See TracBrowser for help on using the repository browser.