PRCATR1 ; GENERATED FROM 'PRCAP REPAYMENT' PRINT TEMPLATE (#404) ; 05/23/22 ; (FILE 430, MARGIN=80)
G BEGIN
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
Q
DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
X ^DD("DD")
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
I $D(DXS)<9 M DXS=^DIPT(404,"DXS")
S I(0)="^PRCA(430,",J(0)=430
D N:$X>0 Q:'DN W ?0 W "BILL NO.: "
S X=$G(^PRCA(430,D0,0)) D N:$X>11 Q:'DN W ?11,$E($P(X,U,1),1,14)
D N:$X>34 Q:'DN W ?34 W "DEBTOR:"
D N:$X>44 Q:'DN W ?44 S Y=$P(X,U,9) S C=$P(^DD(430,9,0),U,2) D Y^DIQ:Y S C="," W $E(Y,1,30)
D N:$X>0 Q:'DN W ?0 W "CURRENT BALANCE: "
D N:$X>18 Q:'DN W ?18 S Y(430,11,1)=$S($D(^PRCA(430,D0,7)):^(7),1:"") S X=$P(Y(430,11,1),U,1)+$P(Y(430,11,1),U,2)+$P(Y(430,11,1),U,3)+$P(Y(430,11,1),U,4)+$P(Y(430,11,1),U,5) S X=$J(X,0,2) W $E(X,1,12) K Y(430,11)
D N:$X>34 Q:'DN W ?34 W "REPAYMENT AMOUNT: "
S X=$G(^PRCA(430,D0,4)) D N:$X>54 Q:'DN W ?54 S Y=$P(X,U,3) W:Y]"" $J(Y,10,2)
D T Q:'DN D N D N:$X>24 Q:'DN W ?24 W "REPAYMENT SCHEDULE"
D N:$X>0 Q:'DN W ?0 S X="-",DIP(1)=X S X=72,X1=DIP(1) S %=X1 X:%]"" "F X=X:0 S %=%_X1 Q:$L(%)>X" S X=$E(%,1,X) K DIP K:DN Y W X
D N:$X>0 Q:'DN W ?0 W "DUE"
D N:$X>17 Q:'DN W ?17 W "PAYMENT"
D N:$X>34 Q:'DN W ?34 W "SEND PAYMENT"
D N:$X>54 Q:'DN W ?54 W "DATE SENT PAYMENT"
D N:$X>0 Q:'DN W ?0 W "DATE"
D N:$X>17 Q:'DN W ?17 W "RECEIVED"
D N:$X>34 Q:'DN W ?34 W "STATEMENT"
D N:$X>54 Q:'DN W ?54 W "STATEMENT"
D N:$X>0 Q:'DN W ?0 S X="-",DIP(1)=X S X=72,X1=DIP(1) S %=X1 X:%]"" "F X=X:0 S %=%_X1 Q:$L(%)>X" S X=$E(%,1,X) K DIP K:DN Y W X
S I(1)=5,J(1)=430.051 F D1=0:0 Q:$O(^PRCA(430,D0,5,D1))'>0 X $G(DSC(430.051)) S D1=$O(^(D1)) Q:D1'>0 D:$X>11 T Q:'DN D A1
G A1R
A1 ;
S X=$G(^PRCA(430,D0,5,D1,0)) D N:$X>0 Q:'DN W ?0 S Y=$P(X,U,1) D DT
D N:$X>17 Q:'DN W ?17 S Y=$P(X,U,2) W:Y]"" $E($$SET^DIQ(430.051,1,Y),1,3)
D N:$X>34 Q:'DN W ?34 S Y=$P(X,U,3) W:Y]"" $E($$SET^DIQ(430.051,2,Y),1,3)
D N:$X>54 Q:'DN W ?54 S Y=$P(X,U,5) D DT
Q
A1R ;
D N:$X>0 Q:'DN W ?0 S X="-",DIP(1)=X S X=72,X1=DIP(1) S %=X1 X:%]"" "F X=X:0 S %=%_X1 Q:$L(%)>X" S X=$E(%,1,X) K DIP K:DN Y W X
K Y
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCATR1 2456 printed Dec 13, 2024@01:41:49 Page 2
PRCATR1 ; GENERATED FROM 'PRCAP REPAYMENT' PRINT TEMPLATE (#404) ; 05/23/22 ; (FILE 430, MARGIN=80)
+1 GOTO BEGIN
N WRITE !
T if $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^UTILITY($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 SET DISTP=DISTP+1
SET DILCT=DILCT+1
if '(DISTP#100)
DO CSTP^DIO2
+2 QUIT
DT IF $GET(DUZ("LANG"))>1
IF Y
WRITE $$OUT^DIALOGU(Y,"DD")
QUIT
+1 XECUTE ^DD("DD")
+2 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 if '$DATA(DN)
SET DN=1
SET DISTP=$GET(DISTP)
SET DILCT=$GET(DILCT)
+2 IF $DATA(DXS)<9
MERGE DXS=^DIPT(404,"DXS")
+3 SET I(0)="^PRCA(430,"
SET J(0)=430
+4 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "BILL NO.: "
+5 SET X=$GET(^PRCA(430,D0,0))
if $X>11
DO N
if 'DN
QUIT
WRITE ?11,$EXTRACT($PIECE(X,U,1),1,14)
+6 if $X>34
DO N
if 'DN
QUIT
WRITE ?34
WRITE "DEBTOR:"
+7 if $X>44
DO N
if 'DN
QUIT
WRITE ?44
SET Y=$PIECE(X,U,9)
SET C=$PIECE(^DD(430,9,0),U,2)
if Y
DO Y^DIQ
SET C=","
WRITE $EXTRACT(Y,1,30)
+8 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "CURRENT BALANCE: "
+9 if $X>18
DO N
if 'DN
QUIT
WRITE ?18
SET Y(430,11,1)=$SELECT($DATA(^PRCA(430,D0,7)):^(7),1:"")
SET X=$PIECE(Y(430,11,1),U,1)+$PIECE(Y(430,11,1),U,2)+$PIECE(Y(430,11,1),U,3)+$PIECE(Y(430,11,1),U,4)+$PIECE(Y(430,11,1),U,5)
SET X=$JUSTIFY(X,0,2)
WRITE $EXTRACT(X,1,12)
KILL Y(430,11)
+10 if $X>34
DO N
if 'DN
QUIT
WRITE ?34
WRITE "REPAYMENT AMOUNT: "
+11 SET X=$GET(^PRCA(430,D0,4))
if $X>54
DO N
if 'DN
QUIT
WRITE ?54
SET Y=$PIECE(X,U,3)
if Y]""
WRITE $JUSTIFY(Y,10,2)
+12 DO T
if 'DN
QUIT
DO N
if $X>24
DO N
if 'DN
QUIT
WRITE ?24
WRITE "REPAYMENT SCHEDULE"
+13 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
SET X="-"
SET DIP(1)=X
SET X=72
SET X1=DIP(1)
SET %=X1
if %]""
XECUTE "F X=X:0 S %=%_X1 Q:$L(%)>X"
SET X=$EXTRACT(%,1,X)
KILL DIP
if DN
KILL Y
WRITE X
+14 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "DUE"
+15 if $X>17
DO N
if 'DN
QUIT
WRITE ?17
WRITE "PAYMENT"
+16 if $X>34
DO N
if 'DN
QUIT
WRITE ?34
WRITE "SEND PAYMENT"
+17 if $X>54
DO N
if 'DN
QUIT
WRITE ?54
WRITE "DATE SENT PAYMENT"
+18 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "DATE"
+19 if $X>17
DO N
if 'DN
QUIT
WRITE ?17
WRITE "RECEIVED"
+20 if $X>34
DO N
if 'DN
QUIT
WRITE ?34
WRITE "STATEMENT"
+21 if $X>54
DO N
if 'DN
QUIT
WRITE ?54
WRITE "STATEMENT"
+22 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
SET X="-"
SET DIP(1)=X
SET X=72
SET X1=DIP(1)
SET %=X1
if %]""
XECUTE "F X=X:0 S %=%_X1 Q:$L(%)>X"
SET X=$EXTRACT(%,1,X)
KILL DIP
if DN
KILL Y
WRITE X
+23 SET I(1)=5
SET J(1)=430.051
FOR D1=0:0
if $ORDER(^PRCA(430,D0,5,D1))'>0
QUIT
XECUTE $GET(DSC(430.051))
SET D1=$ORDER(^(D1))
if D1'>0
QUIT
if $X>11
DO T
if 'DN
QUIT
DO A1
+24 GOTO A1R
A1 ;
+1 SET X=$GET(^PRCA(430,D0,5,D1,0))
if $X>0
DO N
if 'DN
QUIT
WRITE ?0
SET Y=$PIECE(X,U,1)
DO DT
+2 if $X>17
DO N
if 'DN
QUIT
WRITE ?17
SET Y=$PIECE(X,U,2)
if Y]""
WRITE $EXTRACT($$SET^DIQ(430.051,1,Y),1,3)
+3 if $X>34
DO N
if 'DN
QUIT
WRITE ?34
SET Y=$PIECE(X,U,3)
if Y]""
WRITE $EXTRACT($$SET^DIQ(430.051,2,Y),1,3)
+4 if $X>54
DO N
if 'DN
QUIT
WRITE ?54
SET Y=$PIECE(X,U,5)
DO DT
+5 QUIT
A1R ;
+1 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
SET X="-"
SET DIP(1)=X
SET X=72
SET X1=DIP(1)
SET %=X1
if %]""
XECUTE "F X=X:0 S %=%_X1 Q:$L(%)>X"
SET X=$EXTRACT(%,1,X)
KILL DIP
if DN
KILL Y
WRITE X
+2 KILL Y
+3 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!