PRSRTLPR ;HISC/JH-DISPLAY/PRINT SUP.,TIMEKEPPER,OT SUP. ;5/8/95
;;4.0;PAID;**2,6,10,16,17,126**;Sep 21, 1995;Build 59
FIS S PRSR=2,PRSTLV=3
;
;Time&Leave selection. Return TLE array populated with info about
;the T&L unit the user selected.
D TLESEL^PRSRUT0 G Q:$G(TLE)=""!(SSN="") W ! S SW=$S(TLE>1:1,1:0)
S ZTRTN="START^PRSRTLPR",ZTDESC="TIMEKEEPER,SUP.,O/T SUP. REPORT" D ST^PRSRUTL,LOOP,QUE1^PRSRUT0 G Q1:POP!($D(ZTSK))
;
START K ^TMP($J,"TLPR")
S ^TMP($J,"TLPR")="P A I D T & L R E P O R T",(CNT,POUT)=0
;
;set up the TMP global with timekeepers, supervisors, approvers
;on nodes 1,2,3 respectively. Outer loop controls separate T&L units
S J=0 F II=0:0 S J=$O(TLE(J)) Q:J'>0 D
. S DA(1)=$P(TLE(J),U) Q:DA(1)="" S DA(2)=$P(TLE(J),U,2) D SORT
S DAT=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3) U IO D HDR1
I 'CNT W !,"|",?10,"No Timekeepers, Supervisors or O/T Supervisors on file.",?79,"|" S POUT=1 D NONE
G Q1:POUT
S CNT=1,(HOLD,TLE)=""
;
; PRINT out each T&L unit
F I=0:0 S TLE=$O(^TMP($J,"TLPR",TLE)) Q:TLE="" D Q:POUT
.; Get one of each job function to print horizontally.
.; quit if all three job function nodes are exhausted.
. F II=1:1 S MORE=$$GETNEXT(.TMK,.SUP,.OTA,II) D Q:'MORE!(POUT)
.. S NAM(1)=$S($P(TMK,U)'="":$E($P($G(^VA(200,$P(TMK,U),0)),U),1,22),1:"")
.. S NAM(2)=$S($P(SUP,U)'="":$E($P($G(^VA(200,$P(SUP,U),0)),U),1,22),1:"")
.. S NAM(3)=$S($P(OTA,U)'="":$E($P($G(^VA(200,$P(OTA,U),0)),U),1,22),1:"")
.. D:$Y>(IOSL-5) HDR Q:POUT W !,"|",$S(TLE'=HOLD:TLE,1:""),?5,"|",$S(NAM(1)'="":NAM(1),1:""),?28,"|",$S(NAM(2)'="":NAM(2),1:""),?52,$P(SUP,U,2),?56,"|",$S(NAM(3)'="":NAM(3),1:""),?79,"|"
.. S HOLD=TLE,CNT=CNT+2 Q
. D:'POUT VLIN0 S CNT=1 Q
I IOSL<66 F I=$Y:1:IOSL-5 D VLIN0
G Q1:POUT I CNT D VLIN1 S CODE="T001",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT2^PRSRUT0
Q I $E(IOST)="C" R !!,"Press Return/Enter to continue. ",X:DTIME
Q1 K ANT,CNT,COD,CODE,D0,DA,DAT,DIC,FOOT,HOLD,I,II,J,POP,POUT,PRSR,PRSTLV,NAM,SNT,SSN,SW,TL,TLA,TLE,TLI,TLS,TNT,TLT,TLUNIT,X,Y,Z1,ZTDESC,ZTRTN,ZTSAVE,^TMP($J,"TLPR") D ^%ZISC S:$D(ZTSK) ZTREQ="@" K ZTSK
Q
GETNEXT(TK,SV,OT,NODE) ;
;get the next timekeeper, supervisor, and OT/CT approver
S RTN=1
S TK=$G(^TMP($J,"TLPR",TLE,1,NODE))
S SV=$G(^TMP($J,"TLPR",TLE,2,NODE))
S OT=$G(^TMP($J,"TLPR",TLE,3,NODE))
I TK=""&(SV="")&(OT="") S RTN=0
Q RTN
SORT ;modified by John Heiges patch 17.
N J,JFN,NEXT
; loop thru job function multiples (timekeep, supervr & OT/CT)
; and store in ^TMP($J,
; JFN = job function node
; timekeepers->node 1, supervisors->node 2, ot/ct approvers->node 3
; DA(1)= T&L unit #
; DA = T&L unit internal entry #
;
; get ien of T&L unit
S DA="" S DA=$O(^PRST(455.5,"B",DA(1),DA)) Q:DA'>0
;
; loop thru each job function multiple
F COD="A","S","T" I $D(^PRST(455.5,DA,COD)) D
. S JFN=$S(COD="T":1,COD="S":2,COD="A":3,1:0)
. S D0=0
. F NEXT=1:1 S D0=$O(^PRST(455.5,DA,COD,D0)) Q:D0'>0 D
.. S TL=$P($G(^PRST(455.5,DA,COD,D0,0)),U,2)
.. S ^TMP($J,"TLPR",DA(1),JFN,NEXT)=D0_U_TL
.. S CNT=1
.. Q
. Q
Q
NONE I IOSL<66 F I=$Y:1:IOSL-5 D VLIN0
D HDR
Q
HDR D VLIN1 S CODE="T001",FOOT="VA TIME & ATTENDANCE SYSTEM" D FOOT2^PRSRUT0
I $E(IOST)="C" R !,"Press Return/Enter to continue. ",X:DTIME S:'$T!(X="^")!($G(NAM(1))=""&($G(NAM(2))=""&($G(NAM(3))=""))) POUT=1
Q:POUT
HDR1 W:$E(IOST)="C" @IOF W !?26,^TMP($J,"TLPR"),?66,"DATE: ",DAT,!
W !,"|",?5,"|",?28,"|",?52,"CERT",?56,"|",?79,"|"
W !,"|","T&L",?5,"|","TIMEKEEPER",?28,"|","SUPERVISOR",?52,"T&L",?56,"|","O/T SUPERVISOR",?79,"|" D VLIN1 Q
VLIN0 W !,"|",?5,"|",?28,"|",?56,"|",?79,"|" Q
VLIN1 W !,"|----|----------------------|---------------------------|----------------------|" Q
LOOP F X="TLE*","SW" S ZTSAVE(X)=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSRTLPR 3808 printed Nov 22, 2024@17:38:42 Page 2
PRSRTLPR ;HISC/JH-DISPLAY/PRINT SUP.,TIMEKEPPER,OT SUP. ;5/8/95
+1 ;;4.0;PAID;**2,6,10,16,17,126**;Sep 21, 1995;Build 59
FIS SET PRSR=2
SET PRSTLV=3
+1 ;
+2 ;Time&Leave selection. Return TLE array populated with info about
+3 ;the T&L unit the user selected.
+4 DO TLESEL^PRSRUT0
if $GET(TLE)=""!(SSN="")
GOTO Q
WRITE !
SET SW=$SELECT(TLE>1:1,1:0)
+5 SET ZTRTN="START^PRSRTLPR"
SET ZTDESC="TIMEKEEPER,SUP.,O/T SUP. REPORT"
DO ST^PRSRUTL
DO LOOP
DO QUE1^PRSRUT0
if POP!($DATA(ZTSK))
GOTO Q1
+6 ;
START KILL ^TMP($JOB,"TLPR")
+1 SET ^TMP($JOB,"TLPR")="P A I D T & L R E P O R T"
SET (CNT,POUT)=0
+2 ;
+3 ;set up the TMP global with timekeepers, supervisors, approvers
+4 ;on nodes 1,2,3 respectively. Outer loop controls separate T&L units
+5 SET J=0
FOR II=0:0
SET J=$ORDER(TLE(J))
if J'>0
QUIT
Begin DoDot:1
+6 SET DA(1)=$PIECE(TLE(J),U)
if DA(1)=""
QUIT
SET DA(2)=$PIECE(TLE(J),U,2)
DO SORT
End DoDot:1
+7 SET DAT=$EXTRACT(DT,4,5)_"/"_$EXTRACT(DT,6,7)_"/"_$EXTRACT(DT,2,3)
USE IO
DO HDR1
+8 IF 'CNT
WRITE !,"|",?10,"No Timekeepers, Supervisors or O/T Supervisors on file.",?79,"|"
SET POUT=1
DO NONE
+9 if POUT
GOTO Q1
+10 SET CNT=1
SET (HOLD,TLE)=""
+11 ;
+12 ; PRINT out each T&L unit
+13 FOR I=0:0
SET TLE=$ORDER(^TMP($JOB,"TLPR",TLE))
if TLE=""
QUIT
Begin DoDot:1
+14 ; Get one of each job function to print horizontally.
+15 ; quit if all three job function nodes are exhausted.
+16 FOR II=1:1
SET MORE=$$GETNEXT(.TMK,.SUP,.OTA,II)
Begin DoDot:2
+17 SET NAM(1)=$SELECT($PIECE(TMK,U)'="":$EXTRACT($PIECE($GET(^VA(200,$PIECE(TMK,U),0)),U),1,22),1:"")
+18 SET NAM(2)=$SELECT($PIECE(SUP,U)'="":$EXTRACT($PIECE($GET(^VA(200,$PIECE(SUP,U),0)),U),1,22),1:"")
+19 SET NAM(3)=$SELECT($PIECE(OTA,U)'="":$EXTRACT($PIECE($GET(^VA(200,$PIECE(OTA,U),0)),U),1,22),1:"")
+20 if $Y>(IOSL-5)
DO HDR
if POUT
QUIT
WRITE !,"|",$SELECT(TLE'=HOLD:TLE,1:""),?5,"|",$SELECT(NAM(1)'="":NAM(1),1:""),?28,"|",$SELECT(NAM(2)'="":NAM(2),1:""),?52,$PIECE(SUP,U,2),?56,"|",$SELECT(NAM(3)'="":NAM(3),1:""),?79,"|"
+21 SET HOLD=TLE
SET CNT=CNT+2
QUIT
End DoDot:2
if 'MORE!(POUT)
QUIT
+22 if 'POUT
DO VLIN0
SET CNT=1
QUIT
End DoDot:1
if POUT
QUIT
+23 IF IOSL<66
FOR I=$Y:1:IOSL-5
DO VLIN0
+24 if POUT
GOTO Q1
IF CNT
DO VLIN1
SET CODE="T001"
SET FOOT="VA TIME & ATTENDANCE SYSTEM"
DO FOOT2^PRSRUT0
Q IF $EXTRACT(IOST)="C"
READ !!,"Press Return/Enter to continue. ",X:DTIME
Q1 KILL ANT,CNT,COD,CODE,D0,DA,DAT,DIC,FOOT,HOLD,I,II,J,POP,POUT,PRSR,PRSTLV,NAM,SNT,SSN,SW,TL,TLA,TLE,TLI,TLS,TNT,TLT,TLUNIT,X,Y,Z1,ZTDESC,ZTRTN,ZTSAVE,^TMP($JOB,"TLPR")
DO ^%ZISC
if $DATA(ZTSK)
SET ZTREQ="@"
KILL ZTSK
+1 QUIT
GETNEXT(TK,SV,OT,NODE) ;
+1 ;get the next timekeeper, supervisor, and OT/CT approver
+2 SET RTN=1
+3 SET TK=$GET(^TMP($JOB,"TLPR",TLE,1,NODE))
+4 SET SV=$GET(^TMP($JOB,"TLPR",TLE,2,NODE))
+5 SET OT=$GET(^TMP($JOB,"TLPR",TLE,3,NODE))
+6 IF TK=""&(SV="")&(OT="")
SET RTN=0
+7 QUIT RTN
SORT ;modified by John Heiges patch 17.
+1 NEW J,JFN,NEXT
+2 ; loop thru job function multiples (timekeep, supervr & OT/CT)
+3 ; and store in ^TMP($J,
+4 ; JFN = job function node
+5 ; timekeepers->node 1, supervisors->node 2, ot/ct approvers->node 3
+6 ; DA(1)= T&L unit #
+7 ; DA = T&L unit internal entry #
+8 ;
+9 ; get ien of T&L unit
+10 SET DA=""
SET DA=$ORDER(^PRST(455.5,"B",DA(1),DA))
if DA'>0
QUIT
+11 ;
+12 ; loop thru each job function multiple
+13 FOR COD="A","S","T"
IF $DATA(^PRST(455.5,DA,COD))
Begin DoDot:1
+14 SET JFN=$SELECT(COD="T":1,COD="S":2,COD="A":3,1:0)
+15 SET D0=0
+16 FOR NEXT=1:1
SET D0=$ORDER(^PRST(455.5,DA,COD,D0))
if D0'>0
QUIT
Begin DoDot:2
+17 SET TL=$PIECE($GET(^PRST(455.5,DA,COD,D0,0)),U,2)
+18 SET ^TMP($JOB,"TLPR",DA(1),JFN,NEXT)=D0_U_TL
+19 SET CNT=1
+20 QUIT
End DoDot:2
+21 QUIT
End DoDot:1
+22 QUIT
NONE IF IOSL<66
FOR I=$Y:1:IOSL-5
DO VLIN0
+1 DO HDR
+2 QUIT
HDR DO VLIN1
SET CODE="T001"
SET FOOT="VA TIME & ATTENDANCE SYSTEM"
DO FOOT2^PRSRUT0
+1 IF $EXTRACT(IOST)="C"
READ !,"Press Return/Enter to continue. ",X:DTIME
if '$TEST!(X="^")!($GET(NAM(1))=""&($GET(NAM(2))=""&($GET(NAM(3))="")))
SET POUT=1
+2 if POUT
QUIT
HDR1 if $EXTRACT(IOST)="C"
WRITE @IOF
WRITE !?26,^TMP($JOB,"TLPR"),?66,"DATE: ",DAT,!
+1 WRITE !,"|",?5,"|",?28,"|",?52,"CERT",?56,"|",?79,"|"
+2 WRITE !,"|","T&L",?5,"|","TIMEKEEPER",?28,"|","SUPERVISOR",?52,"T&L",?56,"|","O/T SUPERVISOR",?79,"|"
DO VLIN1
QUIT
VLIN0 WRITE !,"|",?5,"|",?28,"|",?56,"|",?79,"|"
QUIT
VLIN1 WRITE !,"|----|----------------------|---------------------------|----------------------|"
QUIT
LOOP FOR X="TLE*","SW"
SET ZTSAVE(X)=""
+1 QUIT