source: WorldVistAEHR/trunk/r/PAID-PRS/PRSRL2.m@ 1710

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

initial load of WorldVistAEHR

File size: 3.2 KB
RevLine 
[613]1PRSRL2 ;HISC/JH,WIRMFO/JAH-IND. OR ALL EMPLOYEE LEAVE REQUEST REPORT ;3/5/1998
2 ;;4.0;PAID;**2,17,19,39**;Sep 21, 1995
3 ;
4 ;entry point from T&A supervisor menu
5 ;TLESEL allows selection of a T&L unit if user is a supervisor
6 ;of the T&L unit. It returns TLE array populated with T&L unit
7SUP S PRSTLV=3,(PRSAI,PRSR)=1 D TLESEL^PRSRUT0 G Q:$G(TLE)=""!(SSN="")
8 W ! S X="T",%DT="" D ^%DT Q:Y<0 S DT=Y K %DT
9 ;
10EN1 S DIC="^PRSPC("
11 S DIC(0)="AEQZ"
12 S D="ATL"_$P(TLE(1),"^",1)
13 S DIC("S")="I $$INXR^PRSRL1($P(TLE(1),U),Y)"
14 S DIC("A")="Enter employee name (Return for all): "
15 D IX^DIC
16 G Q1:$D(DUOUT)!$D(DTOUT)
17 S PRSRY=Y,PRSRY1=$S($D(Y(0)):Y(0),1:"")
18 I PRSRY'=-1 S D0=$P(PRSRY,"^") D CHKTLE^PRSRUTL G EN1:'STFSW
19 ;
20ASK ;get beginning date for report
21 S %DT("A")="Report Beginning Date "
22 S %DT("B")="T",%DT="AEX"
23 D ^%DT G Q1:$D(DTOUT)!(X="")!(X="^"),MSG2:Y=-1 S FR=Y D DD^%DT S XX=Y
24 ;
25 ;for ending date set default to users response to the begin date ?
26 S %DT("A")="Report Ending Date: "
27 S %DT("B")=XX,%DT(0)=FR
28 S %DT="AEX" D ^%DT G Q1:$D(DTOUT)!(X="^"),MSG2:Y=-1
29 S TO=Y
30 G ASK:FR>TO
31 S X1=FR,X2=-1
32 D C^%DTC S DAT=X,Y=TO D DD^%DT S YY=Y K %DT
33 ;
34 S ZTRTN="START^PRSRL2"
35 S ZTDESC="EMP. LEAVE REQUEST REPORT"
36 W !!,$C(7),"THIS IS A 132-COLUMN REPORT !",!
37 D ST^PRSRUTL,LOOP,QUE1^PRSRUT0 G Q1:POP!($D(ZTSK))
38START S ^TMP($J,"REQ",0)="EMPLOYEE LEAVE REQUEST LIST"
39 S LVT=";"_$P(^DD(458.1,6,0),"^",3)
40 S LVS=";"_$P(^DD(458.1,8,0),"^",3)
41 S (POUT,CNT)=0
42 ;
43 ; user has selected one person for the report
44 I PRSRY'=-1 D SINGLE Q
45 ;
46 ; user has selected all employees for the report
47 S TLUNIT=$S(PRSRDUZ:$P($G(^PRSPC(PRSRDUZ,0)),"^",7),1:"000")
48 S TLI=$S(PRSRDUZ:$P($G(^(0)),"^",8),1:"000")
49 S TLI(0)=0,SW=1
50 F S TLI(0)=$O(TLE(TLI(0))) Q:TLI(0)'>0 S TLI(1)=0 F S TLI(1)=$O(TLE(TLI(0),TLI(1))) Q:TLI(1)'>0 S D0=$P(TLE(TLI(0),TLI(1)),U),NAM=$P(TLE(TLI(0),TLI(1)),U,2) D REQ^PRSRLSOR
51 D IND
52 Q
53SINGLE ;
54 S SW=0
55 S SSN=$S(PRSRY1'="":$P(PRSRY1,"^",9),1:"")
56 S:SSN'="" SSN=$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)
57 S COS=$E($P(PRSRY,"^",49),1,4)
58 S ORG=$E($P(PRSRY,"^",49),5,8)
59 S TLUNIT=$P(^PRSPC(D0,0),"^",7)
60 S TLE=$P(TLE(TL),U)
61 S:ORG ORG=$O(^PRST(454,1,"ORG","B",COS_":"_ORG,""))
62 D REQ^PRSRLSOR,IND
63 Q
64 ;
65 ;
66IND ;
67 S DAT=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
68 U IO
69 I $E(IOST,1,2)="C-" W @IOF
70 I 'CNT D HDR1^PRSRL21:SW=1,HDR2^PRSRL21:SW=0 W !,"|",?10,"No Requests on File within this Date Range.",?131,"|" S POUT=1 D NONE G Q
71 D HDR2^PRSRL21:'SW,PRT2^PRSRL21:'SW,HDR1^PRSRL21:SW,PRT1^PRSRL21:SW G Q1:POUT F I=$Y:1:IOSL-5 D VLIN1^PRSRL21:SW,VLIN^PRSRL21:'SW
72 I CNT D VLIDSH^PRSRL21:'SW,VLIDSH1^PRSRL21:SW S CODE=$S('SW:"L001",1:"L002"),FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT1^PRSRUT0
73Q I $E(IOST,1,2)="C-" R !!,"Press Return/Enter to continue. ",X:DTIME
74Q1 K %DT,BEG,CNT,CODE,COS,COSORG,D0,D1,DA,DAPR,DAT,DAY,DENT,DTOUT,DUOUT,FOOT,II,POP,X1,X2,DIC,DTI,END,FR,I,K,LVS,LVT,NAM,ORG,POUT,PPI,PRSAI,PRSR,PRSRI,PRSRY,PRSRY1
75 K PRSRDUZ,PRSTLV,SCOM,SSN,STFSW,SUPR,SW,TL,TLE,TLI,TLUNIT,TO,TOUR,USR,X,XX,Y,YY,Z,Z1,ZTDESC,ZTRTN,ZTSAVE,^TMP($J) D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
76 Q
77NONE I IOSL<66 F I=$Y:1:IOSL-5 D VLIN1^PRSRL21:SW,VLIN^PRSRL21:'SW
78 D HDR^PRSRL21
79 Q
80MSG2 W !!,*7,"The Date was invalid." G ASK
81LOOP F X="D0","FR","NAM","ORG","TO","TL*","TLE*","TLI","PRSRDUZ","PRSRY","PRSRY1","XX","YY" S ZTSAVE(X)=""
82 Q
Note: See TracBrowser for help on using the repository browser.