Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRCARPS

PRCARPS.m

Go to the documentation of this file.
PRCARPS ;SF-ISC/YJK-REPAYMENT PAYMENT STATEMENT ;10/23/93  9:50 AM
 ;;4.5;Accounts Receivable;**104,315**;Mar 20, 1995;Build 67
 ;;Per VA Directive 6402, this routine should not be modified.
 ;
 ;PRINT THE PAYMENT STATEMENT FOR REPAYMENT PLAN
 N PRCALL
BEGIN ;PRCA*4.5*315 Allow GOTBILL (PRCABN) to be passed in
 I $G(GOTBILL)="" D BILL^PRCAUTL Q:'$D(PRCABN)
 S PRCA("BILLN")=$P(^PRCA(430,PRCABN,0),U,1),PRCA("DEBTOR")=$P(^(0),U,9)
 I $G(GOTBILL)="" I '$D(^PRCA(430,PRCABN,5)) W !,*7,"NO REPAYMENT PLAN FOR THIS ACCOUNT.",! Q
 I $G(GOTBILL)=1 I '$D(^PRCA(430,PRCABN,5)) W !,*7,"NO REPAYMENT PLAN FOR THIS ACCOUNT.",! H 5 Q
 S PRCAREP=1 Q
PRINTST S PRCAREP=0 D BEGIN G:PRCAREP=0 END D EN,KILLV G PRINTST
EN S PRCAPT=0 D GETPT I PRCAPT=0 W !,"NO PAYMENT DATA!",! Q
 I '$D(DT) S %DT="",X="T" D ^%DT S DT=+Y K %DT
 S %ZIS="Q" D ^%ZIS Q:POP  I IO=IO(0) D PRT Q
 I $D(IO("Q")) K IO("Q") D QUE D:IO'=IO(0) CLOSEDV Q
 U IO D PRT Q
PRT K PRCAPP D GETPAY Q:'$D(PRCAPP)  D SETLINE,GETPB,WRST^PRCARPS1
 I '$D(DT) S %DT="",X="T" D ^%DT S DT=+Y K %DT
 I PRCANOD>0 S $P(^PRCA(430,PRCABN,5,PRCANOD,0),U,3)=1,$P(^PRCA(430,PRCABN,5,PRCANOD,0),U,5)=DT
 D CLOSEDV Q
QUE K ZTSK,ZTSAVE S ZTSAVE("PRCAPT")=PRCAPT,ZTSAVE("PRCADUE")=PRCADUE,ZTSAVE("PRCABN")=PRCABN,ZTSAVE("PRCA(""BILLN"")")=PRCA("BILLN"),ZTSAVE("PRCA(""DEBTOR"")")=PRCA("DEBTOR"),ZTSAVE("PRCANOD")=PRCANOD
 S ZTRTN="PRT^PRCARPS",ZTDESC="Repayment Plan Statement" D ^%ZTLOAD K ZTRTN,ZTSAVE Q
CLOSEDV D ^%ZISC Q
KILLV ;
END K PRCAREP,PRCABN,PRCA,PRCAPP,PRCAPB,PRCALN,PRCAST1,PRCACITY,PRCA("DEBTNAM"),PRCA("DEBTOR"),I,PRCADT,PRCADUE,PRCAMT,PRCANOD,PRCAPT,PRCASSAN,PRCAKIP,PRCABN1,PRCA1,PRCATY,PRCARDT,PRCANO D KVAR^VADPT Q
 ;
GETPT S PRCAKEN=+$P(^PRCA(430,PRCABN,5,0),U,4),(PRCADUE,PRCANOD)=0
 F Z=1:1:PRCAKEN I +$P(^PRCA(430,PRCABN,5,Z,0),U,4)>0,+$P(^(0),U,3)'>0 S PRCAPT=$P(^(0),U,4),PRCANOD=Z Q
 F Z=1:1:PRCAKEN I +$P(^PRCA(430,PRCABN,5,Z,0),U,2)<1 S PRCADUE=+$P(^(0),U,1) Q
 K Z,PRCAKEN Q
GETPAY S PRCADT=$P(^PRCA(433,PRCAPT,1),U,1) Q:PRCADT=""
 S Y=PRCADT D DD^%DT
 S PRCADT=$E(PRCADT,4,5)_"/"_$E(PRCADT,6,7)_"/"_$P(Y,", ",2)
 S PRCAMT=+$P(^PRCA(433,PRCAPT,1),U,5) Q:PRCAMT'>0
 S Z3=$S($D(^PRCA(433,PRCAPT,3)):^(3),1:"") Q:Z3=""
 F Z=1:1:5 S PRCAPP(Z)=+$P(Z3,U,Z)
 K Z,Z3 Q
GETPB S Z4=^PRCA(430,PRCABN,7)
 F Z=1:1:5 S PRCAPB(Z)=+$P(Z4,U,Z)
 K Z,Z4 Q
SETLINE S PRCALN=0 S:IOM>87 PRCALN=7 S PRCALN(0)=25+PRCALN,PRCALN(1)=50+PRCALN,PRCALN(2)=52+PRCALN,PRCALN(3)=62+PRCALN,PRCALN(4)=64+PRCALN,PRCALN(5)=10+PRCALN,PRCALN(6)=30+PRCALN
 S PRCALL(1)=18+PRCALN,PRCALL(2)=20+PRCALN,PRCALL(3)=30+PRCALN,PRCALL(4)=32+PRCALN,PRCALL(5)=42+PRCALN,PRCALL(6)=44+PRCALN,PRCALL(7)=54+PRCALN,PRCALL(8)=56+PRCALN,PRCALL(9)=66+PRCALN,PRCALL(10)=68+PRCALN,PRCALL(11)=78+PRCALN Q
 ;==================== REPRINT STATEMENT ============================
EN1 ;Reprint the payment statement.
 S PRCAREP=0 D BEGIN G:+PRCAREP=0 END
 K PRCARDT D DATE G:'$D(PRCARDT) END
 S PRCA1=0 D LOOK I PRCA1=0 W !,*7,"THE DATE DOES NOT MATCH !, PLEASE CHECK REPAYMENT PROFILE.",!! G END
 D CLDATE D EN,KILLV G EN1
LOOK S Z1=0
 F Z0=0:0 S Z1=$O(^PRCA(430,PRCABN,5,Z1)) Q:+Z1'>0  I $P(^(Z1,0),U,5)=PRCARDT S PRCA1=1,PRCABN1=Z1 K Z1 Q
 K Z0 Q
DATE S %DT="AE",%DT("A")="Enter the date the statement was printed: " D ^%DT Q:Y<0  S PRCARDT=+Y Q
CLDATE Q:'$D(^PRCA(430,PRCABN,5,PRCABN1,0))  S $P(^(0),U,3)=0,$P(^(0),U,5)="" Q