PRCSP111 ;WISC/SAW-CONTROL POINT ACTIVITY 1358 PRINOUT CON'T ;11-2-89/14:28
V ;;5.1;IFCAP;;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
S Z=$S($D(PRCSPO):PRC("SITE")_"-"_PRCSPO,1:0) G OB:$D(PRCSOB)
I 'Z!('$D(^PRC(424,"AC",Z))) W !,"Daily Record entries have not yet been entered for this request.",!,"The total committed cost of this request is $" W:$D(^PRCS(410,DA,4)) $J($P(^(4),U),0,2) D UL^PRCSP11 G P
PO D HDR1 S PRCSX=0 D OB S (ET,AT,UT,CT)="" D PO1 W !!,?7,"TOTALS",?26,"$",$J(ET,9,2),?38,$J(AT,9,2),?70,"$",$J((PRCSOT-UT),9,2) K PRCSX,PRCSOT,UT,CT,AT,ET,CAT,CET,PRCSR,PRCSX,PRCSXX,J,JJ D P Q
PO1 I $D(^PRCS(410,DA,10)) S PRCSY=$P(^(10),U,3) I PRCSY,$D(^PRC(442,PRCSY,0)) D PO11
Q
PO11 D HDR F J=1:1 S PRCSX=$O(^PRC(424,"AD",PRCSY,PRCSX)) Q:PRCSX'>0 I $D(^PRC(424,PRCSX,0)),"SF"[$P(^(0),U,4) S Z1=$P(^(0),U,6,10) I Z1 S PRCSR($P(Z1,U,2),PRCSX)=Z1
S PRCSXX="" F J=1:1 S PRCSXX=$O(PRCSR(PRCSXX)) Q:PRCSXX="" D PO12
Q
PO12 S (CAT,CET)="",PRCSX=0 F JJ=1:1 S PRCSX=$O(PRCSR(PRCSXX,PRCSX)) Q:PRCSX'>0 S Z1=PRCSR(PRCSXX,PRCSX),Y=$P(Z1,U) D T D:IOSL-$Y<6 NEWP^PRCSP11,HDR D PO2
S CT=$S(CAT:CT+CAT,1:CT+CET) W !?47,"$",$J(CT,9,2),! K A,E,CAT,CET
Q
;
PO2 W !,Y,?7,$P($P(^PRC(424,PRCSX,0),U),"-",3),?12,$P(Z1,U,2),?26,"$"
S E=$P(Z1,U,5),A=$P(Z1,U,3),UT=UT+$P(Z1,U,4),AT=AT+A,ET=ET+E,CAT=CAT+A,CET=CET+E
I '$D(Z1) S Z1=PRCSR(PRCSXX,PRCSX)
;the naked refernce below refers to ^PRC(424,PRCSX,0)
W $J(E,9,2),?38,$J(A,9,2),?59,"$",$J($P(Z1,U,4),9,2) I $D(PRCSA) W !,?15,$P(^(0),U,14)
Q
P W !!,"VA FORM 4-1358a-ADP (NOV 1987)",! Q
OB ;PRINT ONLY OBLIGATIONS
I '$D(^PRC(424,"AC",Z)) G OB1
S (PRCSOT,X1,UT)="" F I=1:1 S X1=$O(^PRC(424,"AF",Z,X1)) Q:X1'>0 I $D(^PRC(424,X1,0)) S Z1=$P(^(0),U,3,6),PRCSOT=PRCSOT+$P(^(0),U,5) D:IOSL-$Y<3 NEWP^PRCSP11,HDR1 D DR1
D UL^PRCSP11 Q:$D(PRCSX)
OB1 W !!,"The following 1358 obligation/adjustment request is ready for processing:"
S X=$P(^PRCS(410,DA,0),U,1,2) W !,"TRANSACTION NUMBER: ",$P(X,U),?40,"TYPE: ",$S($P(X,U,2)="O":"OBLIGATION",1:"ADJUSTMENT"),?60,"AMOUNT: $",$J($P(^(4),U,8),0,2) D UL^PRCSP11 G P
DR1 I '$D(Z1) S Z1=^PRC(424,X1,0),Z1=$P(Z1,U,3,6)
;the first naked reference below refers to ^PRC(424,X1,0)
S Y=$P(Z1,U,4) D T W !,Y,?7,$P($P(^(0),U),"-",3),?13,$S($D(^PRCS(410,+$P(Z1,U,1),0)):$P(^(0),U,1),1:""),?36,"$",$J($P(Z1,U,3),9,2) W:$D(PRCSX) ?56,"$",$J(PRCSOT,9,2) Q
HDR W !,"AUTHORIZATION & ORDER RECORD",?58,"LIQUIDATION RECORD"
W !!,?28,"INDIVIDUAL/DAILY",!,"DATE",?7,"SEQ#",?14,"REFERENCE",?28,"ESTIMATED",?39,"ACTUAL",?47,"CUMULATIVE",?60,"LIQUID",?71,"UNLIQ BAL" D UL^PRCSP11 Q
HDR1 W !,"ESTIMATED OBLIGATION RECAP",!,"DATE",?7,"REF#",?13,"CPA#",?37,"AMOUNT",?57,"BALANCE" Q
T S Y=$E(Y,4,5)_"/"_$E(Y,6,7) Q ;_"/"_$E(Y,2,3)_$S(Y[".":" "_$E($P(Y,".",2)_"0000",1,2)_":"_$E($P(Y,".",2)_"0000",3,4),1:"") Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCSP111 2850 printed Dec 13, 2024@02:17:54 Page 2
PRCSP111 ;WISC/SAW-CONTROL POINT ACTIVITY 1358 PRINOUT CON'T ;11-2-89/14:28
V ;;5.1;IFCAP;;Oct 20, 2000
+1 ;Per VHA Directive 10-93-142, this routine should not be modified.
+2 SET Z=$SELECT($DATA(PRCSPO):PRC("SITE")_"-"_PRCSPO,1:0)
if $DATA(PRCSOB)
GOTO OB
+3 IF 'Z!('$DATA(^PRC(424,"AC",Z)))
WRITE !,"Daily Record entries have not yet been entered for this request.",!,"The total committed cost of this request is $"
if $DATA(^PRCS(410,DA,4))
WRITE $JUSTIFY($PIECE(^(4),U),0,2)
DO UL^PRCSP11
GOTO P
PO DO HDR1
SET PRCSX=0
DO OB
SET (ET,AT,UT,CT)=""
DO PO1
WRITE !!,?7,"TOTALS",?26,"$",$JUSTIFY(ET,9,2),?38,$JUSTIFY(AT,9,2),?70,"$",$JUSTIFY((PRCSOT-UT),9,2)
KILL PRCSX,PRCSOT,UT,CT,AT,ET,CAT,CET,PRCSR,PRCSX,PRCSXX,J,JJ
DO P
QUIT
PO1 IF $DATA(^PRCS(410,DA,10))
SET PRCSY=$PIECE(^(10),U,3)
IF PRCSY
IF $DATA(^PRC(442,PRCSY,0))
DO PO11
+1 QUIT
PO11 DO HDR
FOR J=1:1
SET PRCSX=$ORDER(^PRC(424,"AD",PRCSY,PRCSX))
if PRCSX'>0
QUIT
IF $DATA(^PRC(424,PRCSX,0))
IF "SF"[$PIECE(^(0),U,4)
SET Z1=$PIECE(^(0),U,6,10)
IF Z1
SET PRCSR($PIECE(Z1,U,2),PRCSX)=Z1
+1 SET PRCSXX=""
FOR J=1:1
SET PRCSXX=$ORDER(PRCSR(PRCSXX))
if PRCSXX=""
QUIT
DO PO12
+2 QUIT
PO12 SET (CAT,CET)=""
SET PRCSX=0
FOR JJ=1:1
SET PRCSX=$ORDER(PRCSR(PRCSXX,PRCSX))
if PRCSX'>0
QUIT
SET Z1=PRCSR(PRCSXX,PRCSX)
SET Y=$PIECE(Z1,U)
DO T
if IOSL-$Y<6
DO NEWP^PRCSP11
DO HDR
DO PO2
+1 SET CT=$SELECT(CAT:CT+CAT,1:CT+CET)
WRITE !?47,"$",$JUSTIFY(CT,9,2),!
KILL A,E,CAT,CET
+2 QUIT
+3 ;
PO2 WRITE !,Y,?7,$PIECE($PIECE(^PRC(424,PRCSX,0),U),"-",3),?12,$PIECE(Z1,U,2),?26,"$"
+1 SET E=$PIECE(Z1,U,5)
SET A=$PIECE(Z1,U,3)
SET UT=UT+$PIECE(Z1,U,4)
SET AT=AT+A
SET ET=ET+E
SET CAT=CAT+A
SET CET=CET+E
+2 IF '$DATA(Z1)
SET Z1=PRCSR(PRCSXX,PRCSX)
+3 ;the naked refernce below refers to ^PRC(424,PRCSX,0)
+4 WRITE $JUSTIFY(E,9,2),?38,$JUSTIFY(A,9,2),?59,"$",$JUSTIFY($PIECE(Z1,U,4),9,2)
IF $DATA(PRCSA)
WRITE !,?15,$PIECE(^(0),U,14)
+5 QUIT
P WRITE !!,"VA FORM 4-1358a-ADP (NOV 1987)",!
QUIT
OB ;PRINT ONLY OBLIGATIONS
+1 IF '$DATA(^PRC(424,"AC",Z))
GOTO OB1
+2 SET (PRCSOT,X1,UT)=""
FOR I=1:1
SET X1=$ORDER(^PRC(424,"AF",Z,X1))
if X1'>0
QUIT
IF $DATA(^PRC(424,X1,0))
SET Z1=$PIECE(^(0),U,3,6)
SET PRCSOT=PRCSOT+$PIECE(^(0),U,5)
if IOSL-$Y<3
DO NEWP^PRCSP11
DO HDR1
DO DR1
+3 DO UL^PRCSP11
if $DATA(PRCSX)
QUIT
OB1 WRITE !!,"The following 1358 obligation/adjustment request is ready for processing:"
+1 SET X=$PIECE(^PRCS(410,DA,0),U,1,2)
WRITE !,"TRANSACTION NUMBER: ",$PIECE(X,U),?40,"TYPE: ",$SELECT($PIECE(X,U,2)="O":"OBLIGATION",1:"ADJUSTMENT"),?60,"AMOUNT: $",$JUSTIFY($PIECE(^(4),U,8),0,2)
DO UL^PRCSP11
GOTO P
DR1 IF '$DATA(Z1)
SET Z1=^PRC(424,X1,0)
SET Z1=$PIECE(Z1,U,3,6)
+1 ;the first naked reference below refers to ^PRC(424,X1,0)
+2 SET Y=$PIECE(Z1,U,4)
DO T
WRITE !,Y,?7,$PIECE($PIECE(^(0),U),"-",3),?13,$SELECT($DATA(^PRCS(410,+$PIECE(Z1,U,1),0)):$PIECE(^(0),U,1),1:""),?36,"$",$JUSTIFY($PIECE(Z1,U,3),9,2)
if $DATA(PRCSX)
WRITE ?56,"$",$JUSTIFY(PRCSOT,9,2)
QUIT
HDR WRITE !,"AUTHORIZATION & ORDER RECORD",?58,"LIQUIDATION RECORD"
+1 WRITE !!,?28,"INDIVIDUAL/DAILY",!,"DATE",?7,"SEQ#",?14,"REFERENCE",?28,"ESTIMATED",?39,"ACTUAL",?47,"CUMULATIVE",?60,"LIQUID",?71,"UNLIQ BAL"
DO UL^PRCSP11
QUIT
HDR1 WRITE !,"ESTIMATED OBLIGATION RECAP",!,"DATE",?7,"REF#",?13,"CPA#",?37,"AMOUNT",?57,"BALANCE"
QUIT
T ;_"/"_$E(Y,2,3)_$S(Y[".":" "_$E($P(Y,".",2)_"0000",1,2)_":"_$E($P(Y,".",2)_"0000",3,4),1:"") Q
SET Y=$EXTRACT(Y,4,5)_"/"_$EXTRACT(Y,6,7)
QUIT