PRSATPD ; HISC/REL-Payroll Clear Prior Exceptions ;8/30/95 09:16
;;4.0;PAID;;Sep 21, 1995
R !!,"Select T&L Unit (or ALL): ",X:DTIME G:'$T!("^"[X) EX S X=$TR(X,"al","AL") I X="ALL" S TLE="" G L1
K DIC S DIC="^PRST(455.5,",DIC(0)="EMQ" D ^DIC G EX:$D(DTOUT),PRSATPD:Y<1
S TLE=$P(Y,"^",2)
L1 S PRSTLV=3 D Q1 G EX
Q1 ; Process List
D NOW^%DTC S DT=%\1,(PG,QT)=0 D HDR I TLE'="" D Q2 G:QT EX D:$Y>3 H1 G EX
S PDA=0 F S PDA=$O(^PRST(458.5,PDA)) Q:PDA'>0 I '$P($G(^PRST(458,PDA,0)),"^",6) D G:QT EX
.S DFN=$P($G(^PRST(458.5,PDA,0)),"^",2) Q:'DFN D CHK
.Q:'$D(^PRST(458.5,"C",DFN,PDA))
.S Y0=$G(^PRSPC(DFN,0)) D PRT Q
D:$Y>3 H1 G EX
Q2 S NX="" F S NX=$O(^PRSPC("ATL"_TLE,NX)) Q:NX="" F DFN=0:0 S DFN=$O(^PRSPC("ATL"_TLE,NX,DFN)) Q:DFN<1 I $D(^PRST(458.5,"C",DFN)) D G:QT Q3
.F PDA=0:0 S PDA=$O(^PRST(458.5,"C",DFN,PDA)) Q:PDA<1 D CHK
.Q:'$D(^PRST(458.5,"C",DFN))
.S Y0=$G(^PRSPC(DFN,0))
.F PDA=0:0 S PDA=$O(^PRST(458.5,"C",DFN,PDA)) Q:PDA<1 D PRT Q:QT
.Q
Q3 Q
CHK ; Check Exception
S X=$G(^PRST(458.5,PDA,0)),PDTI=$P(X,"^",3) Q:'PDTI Q:$P(X,"^",6)
S Y=$G(^PRST(458,"AD",PDTI)),PPI=$P(Y,"^",1),DAY=$P(Y,"^",2) Q:'PPI
S ESTR=$P(X,"^",5)_"^"_$P(X,"^",4)
D ^PRSATPE I '$D(ER) S DA=PDA D REM^PRSATPF Q
F K=0:0 S K=$O(ER(K)) Q:K<1 I ER(K)=ESTR K ER(K) G C1
S DA=PDA D REM^PRSATPF
C1 F K=0:0 S K=$O(ER(K)) Q:K<1 S X1=PDTI,X2=ER(K) D ^PRSATPF
Q
PRT ; List entries
S X=$G(^PRST(458.5,PDA,0)),PDTI=$P(X,"^",3),TIM=$P(X,"^",4),TXT=$P(X,"^",5) Q:'PDTI Q:$P(X,"^",6)
I $Y>(IOSL-6) D HDR Q:QT
W !!,$P(Y0,"^",1) W:$P(Y0,"^",8)'="" " (",$P(Y0,"^",8),")"
S X=PDTI D DTP^PRSAPPU W !?5,Y W:TIM'="" ?16,TIM W ?24,TXT
P0 R !!,"Clear Prior Pay Period Exception? ",X:DTIME S:'$T!(X["^") QT=1 Q:QT S X=$TR(X,"yesno","YESNO")
I $P("YES",X,1)'="",$P("NO",X,1)'="" W *7," Answer YES to Clear or NO or RETURN to bypass" G P0
I X'?1"Y".E Q
D NOW^%DTC S $P(^PRST(458.5,PDA,0),"^",6,8)="1^"_DUZ_"^"_% Q
HDR ; Display Header
D H1 Q:QT W:'($E(IOST,1,2)'="C-"&'PG) @IOF
S PG=PG+1 W !?26,"VA TIME & ATTENDANCE SYSTEM",?72,"Page ",PG
W !?26,"PRIOR PAY PERIOD EXCEPTIONS"
S X=DT D DTP^PRSAPPU W !?35,Y Q
H1 I PG,$E(IOST,1,2)="C-" R !!,"Press RETURN to Continue.",X:DTIME S:'$T!(X["^") QT=1
Q
EX G KILL^XUSCLEAN
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSATPD 2263 printed Sep 02, 2024@19:10:04 Page 2
PRSATPD ; HISC/REL-Payroll Clear Prior Exceptions ;8/30/95 09:16
+1 ;;4.0;PAID;;Sep 21, 1995
+2 READ !!,"Select T&L Unit (or ALL): ",X:DTIME
if '$TEST!("^"[X)
GOTO EX
SET X=$TRANSLATE(X,"al","AL")
IF X="ALL"
SET TLE=""
GOTO L1
+3 KILL DIC
SET DIC="^PRST(455.5,"
SET DIC(0)="EMQ"
DO ^DIC
if $DATA(DTOUT)
GOTO EX
if Y<1
GOTO PRSATPD
+4 SET TLE=$PIECE(Y,"^",2)
L1 SET PRSTLV=3
DO Q1
GOTO EX
Q1 ; Process List
+1 DO NOW^%DTC
SET DT=%\1
SET (PG,QT)=0
DO HDR
IF TLE'=""
DO Q2
if QT
GOTO EX
if $Y>3
DO H1
GOTO EX
+2 SET PDA=0
FOR
SET PDA=$ORDER(^PRST(458.5,PDA))
if PDA'>0
QUIT
IF '$PIECE($GET(^PRST(458,PDA,0)),"^",6)
Begin DoDot:1
+3 SET DFN=$PIECE($GET(^PRST(458.5,PDA,0)),"^",2)
if 'DFN
QUIT
DO CHK
+4 if '$DATA(^PRST(458.5,"C",DFN,PDA))
QUIT
+5 SET Y0=$GET(^PRSPC(DFN,0))
DO PRT
QUIT
End DoDot:1
if QT
GOTO EX
+6 if $Y>3
DO H1
GOTO EX
Q2 SET NX=""
FOR
SET NX=$ORDER(^PRSPC("ATL"_TLE,NX))
if NX=""
QUIT
FOR DFN=0:0
SET DFN=$ORDER(^PRSPC("ATL"_TLE,NX,DFN))
if DFN<1
QUIT
IF $DATA(^PRST(458.5,"C",DFN))
Begin DoDot:1
+1 FOR PDA=0:0
SET PDA=$ORDER(^PRST(458.5,"C",DFN,PDA))
if PDA<1
QUIT
DO CHK
+2 if '$DATA(^PRST(458.5,"C",DFN))
QUIT
+3 SET Y0=$GET(^PRSPC(DFN,0))
+4 FOR PDA=0:0
SET PDA=$ORDER(^PRST(458.5,"C",DFN,PDA))
if PDA<1
QUIT
DO PRT
if QT
QUIT
+5 QUIT
End DoDot:1
if QT
GOTO Q3
Q3 QUIT
CHK ; Check Exception
+1 SET X=$GET(^PRST(458.5,PDA,0))
SET PDTI=$PIECE(X,"^",3)
if 'PDTI
QUIT
if $PIECE(X,"^",6)
QUIT
+2 SET Y=$GET(^PRST(458,"AD",PDTI))
SET PPI=$PIECE(Y,"^",1)
SET DAY=$PIECE(Y,"^",2)
if 'PPI
QUIT
+3 SET ESTR=$PIECE(X,"^",5)_"^"_$PIECE(X,"^",4)
+4 DO ^PRSATPE
IF '$DATA(ER)
SET DA=PDA
DO REM^PRSATPF
QUIT
+5 FOR K=0:0
SET K=$ORDER(ER(K))
if K<1
QUIT
IF ER(K)=ESTR
KILL ER(K)
GOTO C1
+6 SET DA=PDA
DO REM^PRSATPF
C1 FOR K=0:0
SET K=$ORDER(ER(K))
if K<1
QUIT
SET X1=PDTI
SET X2=ER(K)
DO ^PRSATPF
+1 QUIT
PRT ; List entries
+1 SET X=$GET(^PRST(458.5,PDA,0))
SET PDTI=$PIECE(X,"^",3)
SET TIM=$PIECE(X,"^",4)
SET TXT=$PIECE(X,"^",5)
if 'PDTI
QUIT
if $PIECE(X,"^",6)
QUIT
+2 IF $Y>(IOSL-6)
DO HDR
if QT
QUIT
+3 WRITE !!,$PIECE(Y0,"^",1)
if $PIECE(Y0,"^",8)'=""
WRITE " (",$PIECE(Y0,"^",8),")"
+4 SET X=PDTI
DO DTP^PRSAPPU
WRITE !?5,Y
if TIM'=""
WRITE ?16,TIM
WRITE ?24,TXT
P0 READ !!,"Clear Prior Pay Period Exception? ",X:DTIME
if '$TEST!(X["^")
SET QT=1
if QT
QUIT
SET X=$TRANSLATE(X,"yesno","YESNO")
+1 IF $PIECE("YES",X,1)'=""
IF $PIECE("NO",X,1)'=""
WRITE *7," Answer YES to Clear or NO or RETURN to bypass"
GOTO P0
+2 IF X'?1"Y".E
QUIT
+3 DO NOW^%DTC
SET $PIECE(^PRST(458.5,PDA,0),"^",6,8)="1^"_DUZ_"^"_%
QUIT
HDR ; Display Header
+1 DO H1
if QT
QUIT
if '($EXTRACT(IOST,1,2)'="C-"&'PG)
WRITE @IOF
+2 SET PG=PG+1
WRITE !?26,"VA TIME & ATTENDANCE SYSTEM",?72,"Page ",PG
+3 WRITE !?26,"PRIOR PAY PERIOD EXCEPTIONS"
+4 SET X=DT
DO DTP^PRSAPPU
WRITE !?35,Y
QUIT
H1 IF PG
IF $EXTRACT(IOST,1,2)="C-"
READ !!,"Press RETURN to Continue.",X:DTIME
if '$TEST!(X["^")
SET QT=1
+1 QUIT
EX GOTO KILL^XUSCLEAN