PRSROT11 ;HISC/JH-IND. OR ALL EMPLOYEE OT/CT REPORT (Continued) ;7/18/97
;;4.0;PAID;**2,21,28,34,114,117**;Sep 21, 1995;Build 32
;;Per VHA Directive 2004-038, this routine should not be modified.
;
; CP = "|" CP = column PIPE character (used for vertical columns)
;
N CP
S CP="|"
S ORG=$S($D(ORG):$E(ORG,1,12),1:"")
D HDR1
S (PP(1),NAM(1),DAY(1),DATT(1))="",DATE(1)=0
F I=1:1:2 S (SAL(I),COMP(I),COMPU(I),OTH(I),OTP(I))=0
S PP=""
F I=0:0 S PP=$O(^TMP($J,"OT/CP",PP)) Q:PP="" S SW(1)=0 D Q:POUT
.;
. S DATT=0
. F I=0:0 S DATT=$O(^TMP($J,"OT/CP",PP,DATT)) Q:DATT'>0 D Q:POUT
..;
.. S INX=0
.. F I=0:0 S INX=$O(^TMP($J,"OT/CP",PP,DATT,INX)) Q:INX']"" D Q:POUT
...;
... S NAM=""
... F I=0:0 S NAM=$O(^TMP($J,"OT/CP",PP,DATT,INX,NAM)) Q:NAM="" S SW(3)=0 D Q:POUT
.... S D0=0
.... F I=0:0 S D0=$O(^TMP($J,"OT/CP",PP,DATT,INX,NAM,D0)) Q:D0'>0 S TIME=$G(^(D0)) Q:TIME="" D Q:POUT
.....;
..... D:($Y>(IOSL-5)) HDR Q:POUT
..... D VLIN0:PP'=PP(1)
..... W !,CP,$S(PP'=PP(1):$J($P(PP,"-",2),2),1:""),?4,CP,$S(DATT'=DATT(1):DATT,1:""),?14,CP,NAM,?39,CP
..... I PRSTLV=3 W $E($P(TIME,"^")),"XX-XX-",$E($P(TIME,"^"),8,11),?52,CP
..... I PRSTLV=7 W $P(TIME,"^"),?52,CP
..... W $J($P(TIME,"^",2),10,2),?64,CP,$J($P(TIME,"^",3),12,2),?79,CP,$J($P(TIME,"^",4),12,2),?94,CP
..... W $J($P(TIME,"^",5),12,2),?109,CP,$J($P(TIME,"^",6),17,2),?131,CP
..... S SAL(1)=SAL(1)+$P(TIME,"^",2),COMPU(1)=COMPU(1)+$P(TIME,"^",3),COMP(1)=COMP(1)+$P(TIME,"^",4),OTH(1)=OTH(1)+$P(TIME,"^",5),OTP(1)=OTP(1)+$P(TIME,"^",6),SW(1)=SW(1)+1
..... S SAL(2)=SAL(2)+$P(TIME,"^",2),COMPU(2)=COMPU(2)+$P(TIME,"^",3),COMP(2)=COMP(2)+$P(TIME,"^",4),OTH(2)=OTH(2)+$P(TIME,"^",5),OTP(2)=OTP(2)+$P(TIME,"^",6)
..... Q
.... S PP(1)=PP,DATT(1)=DATT,NAM(1)=NAM,DATE(1)=DATE Q
.... Q
... Q
.. Q
. Q:POUT I SW(1) D
.. W !
.. D TABLANK0,ROWSEP
. D TABLANK0
. W " P/P-Totals:"
. D WTOT(1)
. S (SAL(1),COMPU(1),COMP(1),OTH(1),OTP(1))=0
. Q
Q:POUT
I SW(1) D
. D VLIN0
. D VLINUND
;
D TABLANK0
W ?44,"TOTALS:"
D WTOT(2)
I IOSL<66 D VLIN0
Q
WTOT(PERIOD) ;Write out pay period totals (1) OR running totals.
S I=PERIOD
W ?53,$J(SAL(I),10,2)
W ?65,$J(COMPU(I),12,2)
W ?80,$J(COMP(I),12,2)
W ?95,$J(OTH(I),12,2)
W ?110,$J(OTP(I),17,2),?131,CP
Q
CHK S X1=DATE,X2=DATE(1) D ^%DTC Q
HDR S CODE="O001",FOOT="VA TIME & ATTENDANCE SYSTEM"
D VLIDSH0,FOOT1^PRSRUT0
I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR I $D(DIRUT) S POUT=1
Q:POUT
W @IOF
HDR1 N CP S CP="|"
W !?(IOM-$L(^TMP($J,"OT/CP")))/2,^TMP($J,"OT/CP"),?(IOM-14),"DATE: ",DAT
S X="T&L: "_$P(TLE(1),U)_" Employee: "_$S(SW:"ALL",1:$P(PRSRY,U,2))
S X=X_" Year: "_YEAR_" Payperiod"
S X=X_$S(PPE(1)=PPE(2):": "_PPE(1),1:"s: "_PPE(1)_" to "_PPE(2))
W !,?(IOM-$L(X)/2-1),X,!
W !,CP,"P/P",?4,CP,?7,"DATE",?14,CP,?25,"NAME",?39,CP,?44,"SSN",?52,CP,?54,"GROSS PAY",?64,CP,?67,"CT/CH USED",?79,CP,?82,"CT/CH BAL",?94,CP,?97,"OVER/T HRS",?109,CP,?118,"OVER/T PAY",?131,CP D VLIDSH0 Q
;
VLIDSH0 ;
W !,"|---|---------|------------------------|------------|-----------|--------------|--------------|--------------|---------------------|" Q
;
VLIN0 ;
W !
D TABLANK0,TABLANK1
Q
;
VLINUND ;use leading blank columns & trailing row separator.
W ! D TABLANK0,ROWSEP Q
;
TABLANK0 ;leading blank columns with vertical slash for column breaks.
N CP S CP="|"
W CP,?4,CP,?14,CP,?39,CP Q
;
TABLANK1 ;2nd half of blank columns w/ vertical slash for column breaks.
N CP S CP="|"
W ?52,CP,?64,CP,?79,CP,?94,CP,?109,CP,?131,CP Q
;
ROWSEP ;row separator (2nd half of line)
N CP S CP="|"
W ?52,CP," --------- ",CP," ------- "
W ?79,CP," ------- "
W ?94,CP," ------- "
W ?109,CP," ---------- "
W ?131,CP,!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSROT11 3834 printed Nov 22, 2024@17:38:41 Page 2
PRSROT11 ;HISC/JH-IND. OR ALL EMPLOYEE OT/CT REPORT (Continued) ;7/18/97
+1 ;;4.0;PAID;**2,21,28,34,114,117**;Sep 21, 1995;Build 32
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ; CP = "|" CP = column PIPE character (used for vertical columns)
+5 ;
+6 NEW CP
+7 SET CP="|"
+8 SET ORG=$SELECT($DATA(ORG):$EXTRACT(ORG,1,12),1:"")
+9 DO HDR1
+10 SET (PP(1),NAM(1),DAY(1),DATT(1))=""
SET DATE(1)=0
+11 FOR I=1:1:2
SET (SAL(I),COMP(I),COMPU(I),OTH(I),OTP(I))=0
+12 SET PP=""
+13 FOR I=0:0
SET PP=$ORDER(^TMP($JOB,"OT/CP",PP))
if PP=""
QUIT
SET SW(1)=0
Begin DoDot:1
+14 ;
+15 SET DATT=0
+16 FOR I=0:0
SET DATT=$ORDER(^TMP($JOB,"OT/CP",PP,DATT))
if DATT'>0
QUIT
Begin DoDot:2
+17 ;
+18 SET INX=0
+19 FOR I=0:0
SET INX=$ORDER(^TMP($JOB,"OT/CP",PP,DATT,INX))
if INX']""
QUIT
Begin DoDot:3
+20 ;
+21 SET NAM=""
+22 FOR I=0:0
SET NAM=$ORDER(^TMP($JOB,"OT/CP",PP,DATT,INX,NAM))
if NAM=""
QUIT
SET SW(3)=0
Begin DoDot:4
+23 SET D0=0
+24 FOR I=0:0
SET D0=$ORDER(^TMP($JOB,"OT/CP",PP,DATT,INX,NAM,D0))
if D0'>0
QUIT
SET TIME=$GET(^(D0))
if TIME=""
QUIT
Begin DoDot:5
+25 ;
+26 if ($Y>(IOSL-5))
DO HDR
if POUT
QUIT
+27 if PP'=PP(1)
DO VLIN0
+28 WRITE !,CP,$SELECT(PP'=PP(1):$JUSTIFY($PIECE(PP,"-",2),2),1:""),?4,CP,$SELECT(DATT'=DATT(1):DATT,1:""),?14,CP,NAM,?39,CP
+29 IF PRSTLV=3
WRITE $EXTRACT($PIECE(TIME,"^")),"XX-XX-",$EXTRACT($PIECE(TIME,"^"),8,11),?52,CP
+30 IF PRSTLV=7
WRITE $PIECE(TIME,"^"),?52,CP
+31 WRITE $JUSTIFY($PIECE(TIME,"^",2),10,2),?64,CP,$JUSTIFY($PIECE(TIME,"^",3),12,2),?79,CP,$JUSTIFY($PIECE(TIME,"^",4),12,2),?94,CP
+32 WRITE $JUSTIFY($PIECE(TIME,"^",5),12,2),?109,CP,$JUSTIFY($PIECE(TIME,"^",6),17,2),?131,CP
+33 SET SAL(1)=SAL(1)+$PIECE(TIME,"^",2)
SET COMPU(1)=COMPU(1)+$PIECE(TIME,"^",3)
SET COMP(1)=COMP(1)+$PIECE(TIME,"^",4)
SET OTH(1)=OTH(1)+$PIECE(TIME,"^",5)
SET OTP(1)=OTP(1)+$PIECE(TIME,"^",6)
SET SW(1)=SW(1)+1
+34 SET SAL(2)=SAL(2)+$PIECE(TIME,"^",2)
SET COMPU(2)=COMPU(2)+$PIECE(TIME,"^",3)
SET COMP(2)=COMP(2)+$PIECE(TIME,"^",4)
SET OTH(2)=OTH(2)+$PIECE(TIME,"^",5)
SET OTP(2)=OTP(2)+$PIECE(TIME,"^",6)
+35 QUIT
End DoDot:5
if POUT
QUIT
+36 SET PP(1)=PP
SET DATT(1)=DATT
SET NAM(1)=NAM
SET DATE(1)=DATE
QUIT
+37 QUIT
End DoDot:4
if POUT
QUIT
+38 QUIT
End DoDot:3
if POUT
QUIT
+39 QUIT
End DoDot:2
if POUT
QUIT
+40 if POUT
QUIT
IF SW(1)
Begin DoDot:2
+41 WRITE !
+42 DO TABLANK0
DO ROWSEP
End DoDot:2
+43 DO TABLANK0
+44 WRITE " P/P-Totals:"
+45 DO WTOT(1)
+46 SET (SAL(1),COMPU(1),COMP(1),OTH(1),OTP(1))=0
+47 QUIT
End DoDot:1
if POUT
QUIT
+48 if POUT
QUIT
+49 IF SW(1)
Begin DoDot:1
+50 DO VLIN0
+51 DO VLINUND
End DoDot:1
+52 ;
+53 DO TABLANK0
+54 WRITE ?44,"TOTALS:"
+55 DO WTOT(2)
+56 IF IOSL<66
DO VLIN0
+57 QUIT
WTOT(PERIOD) ;Write out pay period totals (1) OR running totals.
+1 SET I=PERIOD
+2 WRITE ?53,$JUSTIFY(SAL(I),10,2)
+3 WRITE ?65,$JUSTIFY(COMPU(I),12,2)
+4 WRITE ?80,$JUSTIFY(COMP(I),12,2)
+5 WRITE ?95,$JUSTIFY(OTH(I),12,2)
+6 WRITE ?110,$JUSTIFY(OTP(I),17,2),?131,CP
+7 QUIT
CHK SET X1=DATE
SET X2=DATE(1)
DO ^%DTC
QUIT
HDR SET CODE="O001"
SET FOOT="VA TIME & ATTENDANCE SYSTEM"
+1 DO VLIDSH0
DO FOOT1^PRSRUT0
+2 IF $EXTRACT(IOST,1,2)="C-"
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET POUT=1
+3 if POUT
QUIT
+4 WRITE @IOF
HDR1 NEW CP
SET CP="|"
+1 WRITE !?(IOM-$LENGTH(^TMP($JOB,"OT/CP")))/2,^TMP($JOB,"OT/CP"),?(IOM-14),"DATE: ",DAT
+2 SET X="T&L: "_$PIECE(TLE(1),U)_" Employee: "_$SELECT(SW:"ALL",1:$PIECE(PRSRY,U,2))
+3 SET X=X_" Year: "_YEAR_" Payperiod"
+4 SET X=X_$SELECT(PPE(1)=PPE(2):": "_PPE(1),1:"s: "_PPE(1)_" to "_PPE(2))
+5 WRITE !,?(IOM-$LENGTH(X)/2-1),X,!
+6 WRITE !,CP,"P/P",?4,CP,?7,"DATE",?14,CP,?25,"NAME",?39,CP,?44,"SSN",?52,CP,?54,"GROSS PAY",?64,CP,?67,"CT/CH USED",?79,CP,?82,"CT/CH BAL",?94,CP,?97,"OVER/T HRS",?109,CP,?118,"OVER/T PAY",?131,CP
DO VLIDSH0
QUIT
+7 ;
VLIDSH0 ;
+1 WRITE !,"|---|---------|------------------------|------------|-----------|--------------|--------------|--------------|---------------------|"
QUIT
+2 ;
VLIN0 ;
+1 WRITE !
+2 DO TABLANK0
DO TABLANK1
+3 QUIT
+4 ;
VLINUND ;use leading blank columns & trailing row separator.
+1 WRITE !
DO TABLANK0
DO ROWSEP
QUIT
+2 ;
TABLANK0 ;leading blank columns with vertical slash for column breaks.
+1 NEW CP
SET CP="|"
+2 WRITE CP,?4,CP,?14,CP,?39,CP
QUIT
+3 ;
TABLANK1 ;2nd half of blank columns w/ vertical slash for column breaks.
+1 NEW CP
SET CP="|"
+2 WRITE ?52,CP,?64,CP,?79,CP,?94,CP,?109,CP,?131,CP
QUIT
+3 ;
ROWSEP ;row separator (2nd half of line)
+1 NEW CP
SET CP="|"
+2 WRITE ?52,CP," --------- ",CP," ------- "
+3 WRITE ?79,CP," ------- "
+4 WRITE ?94,CP," ------- "
+5 WRITE ?109,CP," ---------- "
+6 WRITE ?131,CP,!
+7 QUIT