PRSRL2 ;HISC/JH,WIRMFO/JAH-IND. OR ALL EMPLOYEE LEAVE REQUEST REPORT ;3/5/1998
;;4.0;PAID;**2,17,19,39**;Sep 21, 1995
;
;entry point from T&A supervisor menu
;TLESEL allows selection of a T&L unit if user is a supervisor
;of the T&L unit. It returns TLE array populated with T&L unit
SUP S PRSTLV=3,(PRSAI,PRSR)=1 D TLESEL^PRSRUT0 G Q:$G(TLE)=""!(SSN="")
W ! S X="T",%DT="" D ^%DT Q:Y<0 S DT=Y K %DT
;
EN1 S DIC="^PRSPC("
S DIC(0)="AEQZ"
S D="ATL"_$P(TLE(1),"^",1)
S DIC("S")="I $$INXR^PRSRL1($P(TLE(1),U),Y)"
S DIC("A")="Enter employee name (Return for all): "
D IX^DIC
G Q1:$D(DUOUT)!$D(DTOUT)
S PRSRY=Y,PRSRY1=$S($D(Y(0)):Y(0),1:"")
I PRSRY'=-1 S D0=$P(PRSRY,"^") D CHKTLE^PRSRUTL G EN1:'STFSW
;
ASK ;get beginning date for report
S %DT("A")="Report Beginning Date "
S %DT("B")="T",%DT="AEX"
D ^%DT G Q1:$D(DTOUT)!(X="")!(X="^"),MSG2:Y=-1 S FR=Y D DD^%DT S XX=Y
;
;for ending date set default to users response to the begin date ?
S %DT("A")="Report Ending Date: "
S %DT("B")=XX,%DT(0)=FR
S %DT="AEX" D ^%DT G Q1:$D(DTOUT)!(X="^"),MSG2:Y=-1
S TO=Y
G ASK:FR>TO
S X1=FR,X2=-1
D C^%DTC S DAT=X,Y=TO D DD^%DT S YY=Y K %DT
;
S ZTRTN="START^PRSRL2"
S ZTDESC="EMP. LEAVE REQUEST REPORT"
W !!,$C(7),"THIS IS A 132-COLUMN REPORT !",!
D ST^PRSRUTL,LOOP,QUE1^PRSRUT0 G Q1:POP!($D(ZTSK))
START S ^TMP($J,"REQ",0)="EMPLOYEE LEAVE REQUEST LIST"
S LVT=";"_$P(^DD(458.1,6,0),"^",3)
S LVS=";"_$P(^DD(458.1,8,0),"^",3)
S (POUT,CNT)=0
;
; user has selected one person for the report
I PRSRY'=-1 D SINGLE Q
;
; user has selected all employees for the report
S TLUNIT=$S(PRSRDUZ:$P($G(^PRSPC(PRSRDUZ,0)),"^",7),1:"000")
S TLI=$S(PRSRDUZ:$P($G(^(0)),"^",8),1:"000")
S TLI(0)=0,SW=1
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
D IND
Q
SINGLE ;
S SW=0
S SSN=$S(PRSRY1'="":$P(PRSRY1,"^",9),1:"")
S:SSN'="" SSN=$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)
S COS=$E($P(PRSRY,"^",49),1,4)
S ORG=$E($P(PRSRY,"^",49),5,8)
S TLUNIT=$P(^PRSPC(D0,0),"^",7)
S TLE=$P(TLE(TL),U)
S:ORG ORG=$O(^PRST(454,1,"ORG","B",COS_":"_ORG,""))
D REQ^PRSRLSOR,IND
Q
;
;
IND ;
S DAT=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
U IO
I $E(IOST,1,2)="C-" W @IOF
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
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
I CNT D VLIDSH^PRSRL21:'SW,VLIDSH1^PRSRL21:SW S CODE=$S('SW:"L001",1:"L002"),FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT1^PRSRUT0
Q I $E(IOST,1,2)="C-" R !!,"Press Return/Enter to continue. ",X:DTIME
Q1 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
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="@"
Q
NONE I IOSL<66 F I=$Y:1:IOSL-5 D VLIN1^PRSRL21:SW,VLIN^PRSRL21:'SW
D HDR^PRSRL21
Q
MSG2 W !!,*7,"The Date was invalid." G ASK
LOOP F X="D0","FR","NAM","ORG","TO","TL*","TLE*","TLI","PRSRDUZ","PRSRY","PRSRY1","XX","YY" S ZTSAVE(X)=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSRL2 3408 printed Dec 13, 2024@02:28:31 Page 2
PRSRL2 ;HISC/JH,WIRMFO/JAH-IND. OR ALL EMPLOYEE LEAVE REQUEST REPORT ;3/5/1998
+1 ;;4.0;PAID;**2,17,19,39**;Sep 21, 1995
+2 ;
+3 ;entry point from T&A supervisor menu
+4 ;TLESEL allows selection of a T&L unit if user is a supervisor
+5 ;of the T&L unit. It returns TLE array populated with T&L unit
SUP SET PRSTLV=3
SET (PRSAI,PRSR)=1
DO TLESEL^PRSRUT0
if $GET(TLE)=""!(SSN="")
GOTO Q
+1 WRITE !
SET X="T"
SET %DT=""
DO ^%DT
if Y<0
QUIT
SET DT=Y
KILL %DT
+2 ;
EN1 SET DIC="^PRSPC("
+1 SET DIC(0)="AEQZ"
+2 SET D="ATL"_$PIECE(TLE(1),"^",1)
+3 SET DIC("S")="I $$INXR^PRSRL1($P(TLE(1),U),Y)"
+4 SET DIC("A")="Enter employee name (Return for all): "
+5 DO IX^DIC
+6 if $DATA(DUOUT)!$DATA(DTOUT)
GOTO Q1
+7 SET PRSRY=Y
SET PRSRY1=$SELECT($DATA(Y(0)):Y(0),1:"")
+8 IF PRSRY'=-1
SET D0=$PIECE(PRSRY,"^")
DO CHKTLE^PRSRUTL
if 'STFSW
GOTO EN1
+9 ;
ASK ;get beginning date for report
+1 SET %DT("A")="Report Beginning Date "
+2 SET %DT("B")="T"
SET %DT="AEX"
+3 DO ^%DT
if $DATA(DTOUT)!(X="")!(X="^")
GOTO Q1
if Y=-1
GOTO MSG2
SET FR=Y
DO DD^%DT
SET XX=Y
+4 ;
+5 ;for ending date set default to users response to the begin date ?
+6 SET %DT("A")="Report Ending Date: "
+7 SET %DT("B")=XX
SET %DT(0)=FR
+8 SET %DT="AEX"
DO ^%DT
if $DATA(DTOUT)!(X="^")
GOTO Q1
if Y=-1
GOTO MSG2
+9 SET TO=Y
+10 if FR>TO
GOTO ASK
+11 SET X1=FR
SET X2=-1
+12 DO C^%DTC
SET DAT=X
SET Y=TO
DO DD^%DT
SET YY=Y
KILL %DT
+13 ;
+14 SET ZTRTN="START^PRSRL2"
+15 SET ZTDESC="EMP. LEAVE REQUEST REPORT"
+16 WRITE !!,$CHAR(7),"THIS IS A 132-COLUMN REPORT !",!
+17 DO ST^PRSRUTL
DO LOOP
DO QUE1^PRSRUT0
if POP!($DATA(ZTSK))
GOTO Q1
START SET ^TMP($JOB,"REQ",0)="EMPLOYEE LEAVE REQUEST LIST"
+1 SET LVT=";"_$PIECE(^DD(458.1,6,0),"^",3)
+2 SET LVS=";"_$PIECE(^DD(458.1,8,0),"^",3)
+3 SET (POUT,CNT)=0
+4 ;
+5 ; user has selected one person for the report
+6 IF PRSRY'=-1
DO SINGLE
QUIT
+7 ;
+8 ; user has selected all employees for the report
+9 SET TLUNIT=$SELECT(PRSRDUZ:$PIECE($GET(^PRSPC(PRSRDUZ,0)),"^",7),1:"000")
+10 SET TLI=$SELECT(PRSRDUZ:$PIECE($GET(^(0)),"^",8),1:"000")
+11 SET TLI(0)=0
SET SW=1
+12 FOR
SET TLI(0)=$ORDER(TLE(TLI(0)))
if TLI(0)'>0
QUIT
SET TLI(1)=0
FOR
SET TLI(1)=$ORDER(TLE(TLI(0),TLI(1)))
if TLI(1)'>0
QUIT
SET D0=$PIECE(TLE(TLI(0),TLI(1)),U)
SET NAM=$PIECE(TLE(TLI(0),TLI(1)),U,2)
DO REQ^PRSRLSOR
+13 DO IND
+14 QUIT
SINGLE ;
+1 SET SW=0
+2 SET SSN=$SELECT(PRSRY1'="":$PIECE(PRSRY1,"^",9),1:"")
+3 if SSN'=""
SET SSN=$EXTRACT(SSN,1,3)_"-"_$EXTRACT(SSN,4,5)_"-"_$EXTRACT(SSN,6,9)
+4 SET COS=$EXTRACT($PIECE(PRSRY,"^",49),1,4)
+5 SET ORG=$EXTRACT($PIECE(PRSRY,"^",49),5,8)
+6 SET TLUNIT=$PIECE(^PRSPC(D0,0),"^",7)
+7 SET TLE=$PIECE(TLE(TL),U)
+8 if ORG
SET ORG=$ORDER(^PRST(454,1,"ORG","B",COS_":"_ORG,""))
+9 DO REQ^PRSRLSOR
DO IND
+10 QUIT
+11 ;
+12 ;
IND ;
+1 SET DAT=$EXTRACT(DT,4,5)_"/"_$EXTRACT(DT,6,7)_"/"_$EXTRACT(DT,2,3)
+2 USE IO
+3 IF $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+4 IF 'CNT
if SW=1
DO HDR1^PRSRL21
if SW=0
DO HDR2^PRSRL21
WRITE !,"|",?10,"No Requests on File within this Date Range.",?131,"|"
SET POUT=1
DO NONE
GOTO Q
+5 if 'SW
DO HDR2^PRSRL21
if 'SW
DO PRT2^PRSRL21
if SW
DO HDR1^PRSRL21
if SW
DO PRT1^PRSRL21
if POUT
GOTO Q1
FOR I=$Y:1:IOSL-5
if SW
DO VLIN1^PRSRL21
if 'SW
DO VLIN^PRSRL21
+6 IF CNT
if 'SW
DO VLIDSH^PRSRL21
if SW
DO VLIDSH1^PRSRL21
SET CODE=$SELECT('SW:"L001",1:"L002")
SET FOOT="VA TIME & ATTENDANCE SYSTEM"
DO FOOT1^PRSRUT0
Q IF $EXTRACT(IOST,1,2)="C-"
READ !!,"Press Return/Enter to continue. ",X:DTIME
Q1 KILL %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
+1 KILL PRSRDUZ,PRSTLV,SCOM,SSN,STFSW,SUPR,SW,TL,TLE,TLI,TLUNIT,TO,TOUR,USR,X,XX,Y,YY,Z,Z1,ZTDESC,ZTRTN,ZTSAVE,^TMP($JOB)
DO ^%ZISC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 QUIT
NONE IF IOSL<66
FOR I=$Y:1:IOSL-5
if SW
DO VLIN1^PRSRL21
if 'SW
DO VLIN^PRSRL21
+1 DO HDR^PRSRL21
+2 QUIT
MSG2 WRITE !!,*7,"The Date was invalid."
GOTO ASK
LOOP FOR X="D0","FR","NAM","ORG","TO","TL*","TLE*","TLI","PRSRDUZ","PRSRY","PRSRY1","XX","YY"
SET ZTSAVE(X)=""
+1 QUIT