PRSRL4 ;WIRMFO/JAH-INDIVIDUAL EMPLOYEE LEAVE USE PATTERN ;22-JAN-1998
;;4.0;PAID;**2,16,19,21,35,103**;Sep 21, 1995
SUP ;
N SSN,PRSTLV,PRSAI,PRSR,TLE,TLI,SW,PRSRDUZ,USR,XX,YY
N ALOO,FR,TO,TOP,FRP,EMPNAM
;
; DA(2)= stores pay periods in Year-pay period # format
;
; set flags for supervisor entry point
S PRSTLV=3,(PRSAI,PRSR)=1
;
; Select 1 T&L unit.
; Defined after TLESEL call
; PRSRDUZ, USR = user IEN in PAID EMPLOYEE (450)
; SSN = users SSN
; SW
; TLE = selected T&L unit code
; TLI = selected T&L unit IEN in T&L unit file (455.5)
; TLE(1) = "T&L unit code ^ T&L unit name"
; TLE(1,n) = "T&L unit member IEN in file (450) ^ member name"
D TLESEL^PRSRUT0 G Q:$G(TLE)=""!(SSN="") W !
;
; TLI = T&L unit of User
S TLI=$S(PRSRDUZ:$P($G(^(0)),"^",8),1:"000")
;
EN1 ; User look up 4 employee under T&L x-ref in 450
S DIC="^PRSPC(",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: "
D IX^DIC
G Q1:$D(DUOUT)!$D(DTOUT)!(Y=-1)
; Save IEN (450) of selected employee in PRSRY. PRSRY1 = 0 node.
; D0 = selected employee name. PRSRSSN = SSN from 0 node of 450.
S PRSRY=Y
S PRSRY1=$S($D(Y(0)):Y(0),1:"") ; 0 node of selected emp from 450
S D0=$P(PRSRY,"^") ; Selected employee IEN from 450
S EMPNAM=$P(PRSRY,"^",2) ; employee Name from 450
S PRSRSSN=$P(PRSRY1,"^",9) ; employee SSN
S SSN=$E(PRSRSSN,1,3)_"-"_$E(PRSRSSN,4,5)_"-"_$E(PRSRSSN,6,9)
S TLUNIT=$P(PRSRY1,"^",7) ; employee Station Number
S TLE=$P(^PRSPC(D0,0),"^",8) ; employ T&L unit
;
; Get cost center/org code (ccoc) description from selected
; employee record. If no description send a bulletin to G.PAD
; & continue using numeric codes instead.
S ORG=$$CCORG^PRSRUTL(PRSRY1)
I +ORG>0 D CCORGBUL^PRSRUTL(ORG,PRSRDUZ,0,EMPNAM)
;
;SW should always get set to zero.
S SW=$S(PRSRY'=-1:0,1:1)
;
D CHKTLE^PRSRUTL G EN1:'STFSW W !
;
ASK ; ask begin date 4 report
S %DT("A")="Enter Beginning Date "
S %DT(0)=-DT ; date must be <= to today
S %DT("B")="T" ; default response of today
S %DT="AEX" ; ask user, echo, must include day & month
D ^%DT
S FR=Y ; FR = FileMan 4mat of begin date
G Q1:$D(DTOUT)!(X="")!(X="^"),MSG2:FR=-1
;
; ask end date 4 report
S %DT("A")="Enter Ending Date "
S %DT("B")="T" ; default date of today
S %DT(0)=FR ; end date must be > begin date
S %DT="AEX" ; ask, echo, day & month
D ^%DT
S TO=Y
G Q1:$D(DTOUT)!(X="")!(X="^"),MSG2:TO=-1
;
; Get external representation of begin & end date 4 display
; XX = begin date
; YY = end date
S Y=FR D DD^%DT S XX=Y
S Y=TO D DD^%DT S YY=Y
;
; Get pay periods (FRP & TOP) that begin & end dates fall in.
; Vars returned from PP call are DAY & PPE
N PPE,D1 S D1=FR D PP^PRSAPPU S FRP=PPE
N PPE,D1 S D1=TO D PP^PRSAPPU S TOP=PP4Y
;
; Ask user if they want to see all leave, including days off &
; Holidays or if they want to see only leave taken immediately
; be4 or after Holidays & days off.
; ALOO = users choice ALL, Only or Uparrow (A or O or ^)
S ALOO=$$ASKDSPLY^PRSRL41()
Q:ALOO["^"
;
;
S ZTRTN="START^PRSRL4",ZTDESC="EMPLOYEE LEAVE USAGE PATTERN" D ST^PRSRUTL,LOOP,QUE1^PRSRUT0 G Q1:POP!($D(ZTSK))
;
;
START ;
; Set up variable 4 Leave check call CKTOUR^PRSUT0 in subroutine LEV
S LVT=";AL:Annual Leave;SL:Sick Leave;WP:Leave Without Pay;ML:Military Leave;TV:Travel;HX:Holiday Excuse;CB:Family Care;"
S LVT=LVT_"AA:Authorized Absence;AD:Adoption;CU:Comp Time/Credit Hrs.;DL:Donor Leave;NL:Non-Pay Annual Leave;RL:Restored Annual Leave;"
S (CNT,POUT,DAT(1))=0
K ^TMP($J)
S ^TMP($J,"USE")="EMPLOYEE LEAVE PATTERN"
S ^TMP($J,"US",0)="COMMENTS"
;
;loop thru Time & Attendance file, 4 digit yr "AB" Pay Period X-ref.
; Start loop w/ payperiod previous begin date
; Quit loop when pay per. is past end date
;
S DA(2)=$$PREP^PRSAPPU(FRP) ;call to get previous pay period
;
F II=0:0 S DA(2)=$O(^PRST(458,"AB",DA(2))) Q:DA(2)=""!(DA(2)]TOP) D
.; get pay period IEN
. S DA(1)=$O(^PRST(458,"AB",DA(2),0))
.;
.; FM dates string 4 curr pay per
. S DATES=$G(^PRST(458,DA(1),1))
.;
.; get days of week 4 current pay period (Sun 9-Jan-94^...^)
.S DAYSOFWK=$G(^PRST(458,DA(1),2))
.;
.; loop thru days of employee's pay period
. S DA=0
. F I=0:0 S DA=$O(^PRST(458,DA(1),"E",D0,"D",DA)) Q:DA'>0 D
..;
..; quit if outside date range
.. Q:$P(DATES,"^",DA)<FR!($P(DATES,"^",DA)>TO)
..;
..; tour of duty 4 current day
.. S TOD=$P($G(^PRST(458,DA(1),"E",D0,"D",DA,0)),"^",2)
..;
..; tour of duty 4 next day
.. S TOD(1)=$P($G(^PRST(458,DA(1),"E",D0,"D",DA+1,0)),"^",2) Q:TOD=""
..;
.. D LEV
.. Q
. Q
S DAT=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
U IO I 'CNT D HDR1^PRSRL41 W !,"|",?10,"No leave Usage on File within this Date Range.",?79,"|" S POUT=1 D NONE G Q1
D ^PRSRL41
G Q1:POUT I CNT D VLIDSH0^PRSRL41 S CODE="L005",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT2^PRSRUT0
;
;
Q I $E(IOST)="C"!($G(IOT)="VTRM") R !!,"Press Return/Enter to continue. ",X:DTIME
Q1 K %9,%DT,%RET,%TG,C,CNT,CODE,COM,COS,COSORG,D0,D1,DA,DAT,DATE,DATES,DATT,DAY,DDH,DIC,EDT,FOOT,FR,FRP,I,II,INX,K,LEV,LVT,NAM,ORG,POP,POUT,PP,PPE,PPI,PRSPRSR,PRSRY,PRSRY1
K RG,SSN,STFSW,SW,TC,TIM,TL,TLE,TLEV,TLI,TLUNIT,TO,TOD,TOP,TOUR,TOUR1,TYL,X,X1,X2,XX,Y,YY,Z,Z1,ZTDESC,ZTRTN,ZTSAVE,^TMP($J) D ^%ZISC S:$D(ZTSK) ZTREQ="@" K ZTSK W:$E(IOST)="C"!($G(IOT)="VTRM") @IOF
Q
LEV ;
S DAY=$P($P(DAYSOFWK,"^",DA)," ") ; current day of week (SUN, MON...)
S DAY(1)=$P($P(DAYSOFWK,"^",DA+1)," ") ; next day of week
;
; TOUR = ((day off) or (NODE with either
; (start and stop times) or (null for worked entire tour))
S TOUR=$S(TOD'=1:$G(^PRST(458,DA(1),"E",D0,"D",DA,2)),1:"DO")
;
;Check 4 leave in LVT variable (SL,AL,ML,TV,HX)
;if today not a day off
;Quit if employee worked entire tour (tour="")
D CKTOUR^PRSRUT0(.TOUR):TOD'=1 Q:TOUR=""
;
;TOUR(1) = same as TOUR exept next day.
S TOUR1=$S(TOD(1)'=1:$G(^PRST(458,DA(1),"E",D0,"D",DA+1,2)),1:"DO")
;
;Check 4 leave in LVT variable (SL,AL,ML,TV,HX)
;if today not a day off
;Quit if employee worked entire tour, unless they've selected ALL
D CKTOUR^PRSRUT0(.TOUR1):TOD(1)'=1 Q:((TOUR1="")&(ALOO'="A"))
;
;Test whether leave should be saved for display
Q:'$$SHOWLEAV()
;
;
;If we've made it this far store the leave or day off in the temp
;global for display, unless it's already there.
I $G(DAY)'="",$G(^TMP($J,"USE",CNT,DA(2),$P(DATES,"^",DA),DAY))'=TOUR D
. S CNT=CNT+1
. S ^TMP($J,"USE",CNT,DA(2),$P(DATES,"^",DA),DAY)=TOUR
. S ^TMP($J,"US",CNT)=$G(^PRST(458,DA(1),"E",D0,"D",DA,3))
;
W:'$D(ZTSK)&($E(IOST)'="P")!($G(IOT)="VTRM")&($R(30)) "."
;
I $G(DAY(1))'="",$G(^TMP($J,"USE",CNT,DA(2),$P(DATES,"^",DA+1),DAY(1)))'=TOUR1 D
. S CNT=CNT+1
. S ^TMP($J,"USE",CNT,DA(2),$P(DATES,"^",DA+1),DAY(1))=TOUR1
. S ^TMP($J,"US",CNT)=$G(^PRST(458,DA(1),"E",D0,"D",DA+1,3))
;
W:'$D(ZTSK)&($E(IOST)'="P")!($G(IOT)="VTRM")&($R(30)) "."
;
;
S DAT(1)=$P(DATES,"^",DA+1),DAY(2)=DAY
Q
NONE I IOSL<66 F I=$Y:1:IOSL-5 D VLIN0^PRSRL41
D HDR^PRSRL41
Q
MSG1 W !!,*7,"*** Employee name not found." G EN1
MSG2 W !!,*7,"The Date was invalid." G ASK
;
;Save all variables 4 tasked job
LOOP F X="ALOO","FR","FRP","TLE","TLI","TO","TOP","DT","NAM","SSN","SW","LOC","POS","PRSRDUZ","PRSRY","PRSRY1","COS","^TMP($J,""USE"",","ORG","D0","TLUNIT","XX","YY","PRSRSSN" S ZTSAVE(X)=""
Q
;=====================================================================
SHOWLEAV() ;
;If user has selected 'All', then show leave (return true)
;
;Otherwise, don't store leave 4 display IF:
; (next day tour = day off) & (current day tour = Holiday) or
; (todays tour = day off) & (next days tour = day off) or
; user has selected only leave around days off &
; (todays tour is not = day off) & (next day is not day off)
;
Q:ALOO="A" 1
S RTN=1
I ((TOD=1&(TOUR1["HX"))!(TOD(1)=1&(TOUR["HX"))!(TOUR="DO"&(TOUR1="DO"))!((ALOO="O")&(TOUR'="DO"&(TOUR1'="DO")))) S RTN=0
Q RTN
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSRL4 8299 printed Dec 13, 2024@02:28:32 Page 2
PRSRL4 ;WIRMFO/JAH-INDIVIDUAL EMPLOYEE LEAVE USE PATTERN ;22-JAN-1998
+1 ;;4.0;PAID;**2,16,19,21,35,103**;Sep 21, 1995
SUP ;
+1 NEW SSN,PRSTLV,PRSAI,PRSR,TLE,TLI,SW,PRSRDUZ,USR,XX,YY
+2 NEW ALOO,FR,TO,TOP,FRP,EMPNAM
+3 ;
+4 ; DA(2)= stores pay periods in Year-pay period # format
+5 ;
+6 ; set flags for supervisor entry point
+7 SET PRSTLV=3
SET (PRSAI,PRSR)=1
+8 ;
+9 ; Select 1 T&L unit.
+10 ; Defined after TLESEL call
+11 ; PRSRDUZ, USR = user IEN in PAID EMPLOYEE (450)
+12 ; SSN = users SSN
+13 ; SW
+14 ; TLE = selected T&L unit code
+15 ; TLI = selected T&L unit IEN in T&L unit file (455.5)
+16 ; TLE(1) = "T&L unit code ^ T&L unit name"
+17 ; TLE(1,n) = "T&L unit member IEN in file (450) ^ member name"
+18 DO TLESEL^PRSRUT0
if $GET(TLE)=""!(SSN="")
GOTO Q
WRITE !
+19 ;
+20 ; TLI = T&L unit of User
+21 SET TLI=$SELECT(PRSRDUZ:$PIECE($GET(^(0)),"^",8),1:"000")
+22 ;
EN1 ; User look up 4 employee under T&L x-ref in 450
+1 SET DIC="^PRSPC("
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: "
+5 DO IX^DIC
+6 if $DATA(DUOUT)!$DATA(DTOUT)!(Y=-1)
GOTO Q1
+7 ; Save IEN (450) of selected employee in PRSRY. PRSRY1 = 0 node.
+8 ; D0 = selected employee name. PRSRSSN = SSN from 0 node of 450.
+9 SET PRSRY=Y
+10 ; 0 node of selected emp from 450
SET PRSRY1=$SELECT($DATA(Y(0)):Y(0),1:"")
+11 ; Selected employee IEN from 450
SET D0=$PIECE(PRSRY,"^")
+12 ; employee Name from 450
SET EMPNAM=$PIECE(PRSRY,"^",2)
+13 ; employee SSN
SET PRSRSSN=$PIECE(PRSRY1,"^",9)
+14 SET SSN=$EXTRACT(PRSRSSN,1,3)_"-"_$EXTRACT(PRSRSSN,4,5)_"-"_$EXTRACT(PRSRSSN,6,9)
+15 ; employee Station Number
SET TLUNIT=$PIECE(PRSRY1,"^",7)
+16 ; employ T&L unit
SET TLE=$PIECE(^PRSPC(D0,0),"^",8)
+17 ;
+18 ; Get cost center/org code (ccoc) description from selected
+19 ; employee record. If no description send a bulletin to G.PAD
+20 ; & continue using numeric codes instead.
+21 SET ORG=$$CCORG^PRSRUTL(PRSRY1)
+22 IF +ORG>0
DO CCORGBUL^PRSRUTL(ORG,PRSRDUZ,0,EMPNAM)
+23 ;
+24 ;SW should always get set to zero.
+25 SET SW=$SELECT(PRSRY'=-1:0,1:1)
+26 ;
+27 DO CHKTLE^PRSRUTL
if 'STFSW
GOTO EN1
WRITE !
+28 ;
ASK ; ask begin date 4 report
+1 SET %DT("A")="Enter Beginning Date "
+2 ; date must be <= to today
SET %DT(0)=-DT
+3 ; default response of today
SET %DT("B")="T"
+4 ; ask user, echo, must include day & month
SET %DT="AEX"
+5 DO ^%DT
+6 ; FR = FileMan 4mat of begin date
SET FR=Y
+7 if $DATA(DTOUT)!(X="")!(X="^")
GOTO Q1
if FR=-1
GOTO MSG2
+8 ;
+9 ; ask end date 4 report
+10 SET %DT("A")="Enter Ending Date "
+11 ; default date of today
SET %DT("B")="T"
+12 ; end date must be > begin date
SET %DT(0)=FR
+13 ; ask, echo, day & month
SET %DT="AEX"
+14 DO ^%DT
+15 SET TO=Y
+16 if $DATA(DTOUT)!(X="")!(X="^")
GOTO Q1
if TO=-1
GOTO MSG2
+17 ;
+18 ; Get external representation of begin & end date 4 display
+19 ; XX = begin date
+20 ; YY = end date
+21 SET Y=FR
DO DD^%DT
SET XX=Y
+22 SET Y=TO
DO DD^%DT
SET YY=Y
+23 ;
+24 ; Get pay periods (FRP & TOP) that begin & end dates fall in.
+25 ; Vars returned from PP call are DAY & PPE
+26 NEW PPE,D1
SET D1=FR
DO PP^PRSAPPU
SET FRP=PPE
+27 NEW PPE,D1
SET D1=TO
DO PP^PRSAPPU
SET TOP=PP4Y
+28 ;
+29 ; Ask user if they want to see all leave, including days off &
+30 ; Holidays or if they want to see only leave taken immediately
+31 ; be4 or after Holidays & days off.
+32 ; ALOO = users choice ALL, Only or Uparrow (A or O or ^)
+33 SET ALOO=$$ASKDSPLY^PRSRL41()
+34 if ALOO["^"
QUIT
+35 ;
+36 ;
+37 SET ZTRTN="START^PRSRL4"
SET ZTDESC="EMPLOYEE LEAVE USAGE PATTERN"
DO ST^PRSRUTL
DO LOOP
DO QUE1^PRSRUT0
if POP!($DATA(ZTSK))
GOTO Q1
+38 ;
+39 ;
START ;
+1 ; Set up variable 4 Leave check call CKTOUR^PRSUT0 in subroutine LEV
+2 SET LVT=";AL:Annual Leave;SL:Sick Leave;WP:Leave Without Pay;ML:Military Leave;TV:Travel;HX:Holiday Excuse;CB:Family Care;"
+3 SET LVT=LVT_"AA:Authorized Absence;AD:Adoption;CU:Comp Time/Credit Hrs.;DL:Donor Leave;NL:Non-Pay Annual Leave;RL:Restored Annual Leave;"
+4 SET (CNT,POUT,DAT(1))=0
+5 KILL ^TMP($JOB)
+6 SET ^TMP($JOB,"USE")="EMPLOYEE LEAVE PATTERN"
+7 SET ^TMP($JOB,"US",0)="COMMENTS"
+8 ;
+9 ;loop thru Time & Attendance file, 4 digit yr "AB" Pay Period X-ref.
+10 ; Start loop w/ payperiod previous begin date
+11 ; Quit loop when pay per. is past end date
+12 ;
+13 ;call to get previous pay period
SET DA(2)=$$PREP^PRSAPPU(FRP)
+14 ;
+15 FOR II=0:0
SET DA(2)=$ORDER(^PRST(458,"AB",DA(2)))
if DA(2)=""!(DA(2)]TOP)
QUIT
Begin DoDot:1
+16 ; get pay period IEN
+17 SET DA(1)=$ORDER(^PRST(458,"AB",DA(2),0))
+18 ;
+19 ; FM dates string 4 curr pay per
+20 SET DATES=$GET(^PRST(458,DA(1),1))
+21 ;
+22 ; get days of week 4 current pay period (Sun 9-Jan-94^...^)
+23 SET DAYSOFWK=$GET(^PRST(458,DA(1),2))
+24 ;
+25 ; loop thru days of employee's pay period
+26 SET DA=0
+27 FOR I=0:0
SET DA=$ORDER(^PRST(458,DA(1),"E",D0,"D",DA))
if DA'>0
QUIT
Begin DoDot:2
+28 ;
+29 ; quit if outside date range
+30 if $PIECE(DATES,"^",DA)<FR!($PIECE(DATES,"^",DA)>TO)
QUIT
+31 ;
+32 ; tour of duty 4 current day
+33 SET TOD=$PIECE($GET(^PRST(458,DA(1),"E",D0,"D",DA,0)),"^",2)
+34 ;
+35 ; tour of duty 4 next day
+36 SET TOD(1)=$PIECE($GET(^PRST(458,DA(1),"E",D0,"D",DA+1,0)),"^",2)
if TOD=""
QUIT
+37 ;
+38 DO LEV
+39 QUIT
End DoDot:2
+40 QUIT
End DoDot:1
+41 SET DAT=$EXTRACT(DT,4,5)_"/"_$EXTRACT(DT,6,7)_"/"_$EXTRACT(DT,2,3)
+42 USE IO
IF 'CNT
DO HDR1^PRSRL41
WRITE !,"|",?10,"No leave Usage on File within this Date Range.",?79,"|"
SET POUT=1
DO NONE
GOTO Q1
+43 DO ^PRSRL41
+44 if POUT
GOTO Q1
IF CNT
DO VLIDSH0^PRSRL41
SET CODE="L005"
SET FOOT="VA TIME & ATTENDANCE SYSTEM"
DO FOOT2^PRSRUT0
+45 ;
+46 ;
Q IF $EXTRACT(IOST)="C"!($GET(IOT)="VTRM")
READ !!,"Press Return/Enter to continue. ",X:DTIME
Q1 KILL %9,%DT,%RET,%TG,C,CNT,CODE,COM,COS,COSORG,D0,D1,DA,DAT,DATE,DATES,DATT,DAY,DDH,DIC,EDT,FOOT,FR,FRP,I,II,INX,K,LEV,LVT,NAM,ORG,POP,POUT,PP,PPE,PPI,PRSPRSR,PRSRY,PRSRY1
+1 KILL RG,SSN,STFSW,SW,TC,TIM,TL,TLE,TLEV,TLI,TLUNIT,TO,TOD,TOP,TOUR,TOUR1,TYL,X,X1,X2,XX,Y,YY,Z,Z1,ZTDESC,ZTRTN,ZTSAVE,^TMP($JOB)
DO ^%ZISC
if $DATA(ZTSK)
SET ZTREQ="@"
KILL ZTSK
if $EXTRACT(IOST)="C"!($GET(IOT)="VTRM")
WRITE @IOF
+2 QUIT
LEV ;
+1 ; current day of week (SUN, MON...)
SET DAY=$PIECE($PIECE(DAYSOFWK,"^",DA)," ")
+2 ; next day of week
SET DAY(1)=$PIECE($PIECE(DAYSOFWK,"^",DA+1)," ")
+3 ;
+4 ; TOUR = ((day off) or (NODE with either
+5 ; (start and stop times) or (null for worked entire tour))
+6 SET TOUR=$SELECT(TOD'=1:$GET(^PRST(458,DA(1),"E",D0,"D",DA,2)),1:"DO")
+7 ;
+8 ;Check 4 leave in LVT variable (SL,AL,ML,TV,HX)
+9 ;if today not a day off
+10 ;Quit if employee worked entire tour (tour="")
+11 if TOD'=1
DO CKTOUR^PRSRUT0(.TOUR)
if TOUR=""
QUIT
+12 ;
+13 ;TOUR(1) = same as TOUR exept next day.
+14 SET TOUR1=$SELECT(TOD(1)'=1:$GET(^PRST(458,DA(1),"E",D0,"D",DA+1,2)),1:"DO")
+15 ;
+16 ;Check 4 leave in LVT variable (SL,AL,ML,TV,HX)
+17 ;if today not a day off
+18 ;Quit if employee worked entire tour, unless they've selected ALL
+19 if TOD(1)'=1
DO CKTOUR^PRSRUT0(.TOUR1)
if ((TOUR1="")&(ALOO'="A"))
QUIT
+20 ;
+21 ;Test whether leave should be saved for display
+22 if '$$SHOWLEAV()
QUIT
+23 ;
+24 ;
+25 ;If we've made it this far store the leave or day off in the temp
+26 ;global for display, unless it's already there.
+27 IF $GET(DAY)'=""
IF $GET(^TMP($JOB,"USE",CNT,DA(2),$PIECE(DATES,"^",DA),DAY))'=TOUR
Begin DoDot:1
+28 SET CNT=CNT+1
+29 SET ^TMP($JOB,"USE",CNT,DA(2),$PIECE(DATES,"^",DA),DAY)=TOUR
+30 SET ^TMP($JOB,"US",CNT)=$GET(^PRST(458,DA(1),"E",D0,"D",DA,3))
End DoDot:1
+31 ;
+32 if '$DATA(ZTSK)&($EXTRACT(IOST)'="P")!($GET(IOT)="VTRM")&($RANDOM(30))
WRITE "."
+33 ;
+34 IF $GET(DAY(1))'=""
IF $GET(^TMP($JOB,"USE",CNT,DA(2),$PIECE(DATES,"^",DA+1),DAY(1)))'=TOUR1
Begin DoDot:1
+35 SET CNT=CNT+1
+36 SET ^TMP($JOB,"USE",CNT,DA(2),$PIECE(DATES,"^",DA+1),DAY(1))=TOUR1
+37 SET ^TMP($JOB,"US",CNT)=$GET(^PRST(458,DA(1),"E",D0,"D",DA+1,3))
End DoDot:1
+38 ;
+39 if '$DATA(ZTSK)&($EXTRACT(IOST)'="P")!($GET(IOT)="VTRM")&($RANDOM(30))
WRITE "."
+40 ;
+41 ;
+42 SET DAT(1)=$PIECE(DATES,"^",DA+1)
SET DAY(2)=DAY
+43 QUIT
NONE IF IOSL<66
FOR I=$Y:1:IOSL-5
DO VLIN0^PRSRL41
+1 DO HDR^PRSRL41
+2 QUIT
MSG1 WRITE !!,*7,"*** Employee name not found."
GOTO EN1
MSG2 WRITE !!,*7,"The Date was invalid."
GOTO ASK
+1 ;
+2 ;Save all variables 4 tasked job
LOOP FOR X="ALOO","FR","FRP","TLE","TLI","TO","TOP","DT","NAM","SSN","SW","LOC","POS","PRSRDUZ","PRSRY","PRSRY1","COS","^TMP($J,""USE"",","ORG","D0","TLUNIT","XX","YY","PRSRSSN"
SET ZTSAVE(X)=""
+1 QUIT
+2 ;=====================================================================
SHOWLEAV() ;
+1 ;If user has selected 'All', then show leave (return true)
+2 ;
+3 ;Otherwise, don't store leave 4 display IF:
+4 ; (next day tour = day off) & (current day tour = Holiday) or
+5 ; (todays tour = day off) & (next days tour = day off) or
+6 ; user has selected only leave around days off &
+7 ; (todays tour is not = day off) & (next day is not day off)
+8 ;
+9 if ALOO="A"
QUIT 1
+10 SET RTN=1
+11 IF ((TOD=1&(TOUR1["HX"))!(TOD(1)=1&(TOUR["HX"))!(TOUR="DO"&(TOUR1="DO"))!((ALOO="O")&(TOUR'="DO"&(TOUR1'="DO"))))
SET RTN=0
+12 QUIT RTN