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

PRCARPM.m

Go to the documentation of this file.
  1. PRCARPM ;ALB/DRF-CREATE MULTIPLE ACCOUNT REPAYMENT DATE SCHEDULE ;08/09/2016 4:40 PM
  1. ;;4.5;Accounts Receivable;**315,340**;Mar 20, 1995;Build 9
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. BEGIN ;Start here
  1. N ACT,ADD,ALL,D0,DEL,DIC,DIR,LIST,LSTDATE,MULTI,NON,PAYDATE,PLN,PLNAMT,PLNDAY,PLNDT
  1. N PLNFRST,PLNLST,PLNNXT,PLNRMN,PLNTDUE,PRCA,PRCADAY,PRCADT,PRCAFP,PRCAFPD,PRCAMT
  1. N PRCANPAY,PRCAPB,PRCAREM,QUIT,SUCCESS,SURE,T,TOTAL,TOTDUE,X,Y
  1. S QUIT=0
  1. I $G(DEBTOR)]"" L -^RCD(340,+DEBTOR) ;Release previous debtor lock
  1. S DEBTOR=$$DEBTOR^PRCARPU()
  1. I $G(DEBTOR)="" K DEBTOR Q
  1. W " ",$$NAM^RCFN01(+DEBTOR)
  1. L +^RCD(340,+DEBTOR):1 I '$T W !,"Another user is editing this record",!! D PAUSE^PRCARPU G BEGIN
  1. D ACCOUNTS^PRCARPU(+DEBTOR,.ALL,.PLN,.NON,.ACT)
  1. I ACT=0 W !,"No active bills for this debtor",!! D PAUSE^PRCARPU G BEGIN
  1. I PLN=0 G NOPLAN ;No current plan
  1. S MULTI=$$MULTI^PRCARPU(.PLN) I MULTI G MULTPLN ;Multiple existing plans
  1. I PLN G PLAN ;Single existing plan
  1. G BEGIN
  1. ;
  1. PLAN ;There is an existing Repayment Plan
  1. S DIR(0)="SA^E:EDIT;D:DELETE;V:VIEW^",DIR("B")="V"
  1. S DIR("A")="This Debtor has a Repayment Plan - (D)elete, (E)dit or (V)iew it? "
  1. D ^DIR
  1. I Y="V" G VIEW
  1. I Y="D" G DELETE
  1. I Y="E",NON G EDITADD
  1. I Y="E",NON=0 G EDIT
  1. G BEGIN
  1. ;
  1. MULTPLN ;There is more than one existing Repayment Plan
  1. S DIR(0)="Y"
  1. S DIR("A")="This Debtor has multiple plans - view them"
  1. S DIR("?")="Enter Y to view multiple Repayment Plans"
  1. D ^DIR I $D(DUOUT)!($D(DTOUT)) G BEGIN
  1. I 'Y G BEGIN
  1. D DSMPLNS^PRCARPU(DEBTOR,.PLN)
  1. I QUIT G BEGIN
  1. S DIR(0)="Y"
  1. S DIR("A")="This Debtor has multiple plans - consolidate them"
  1. S DIR("?")="Enter Y to consolidate multiple Repayment Plans into one"
  1. D ^DIR I $D(DUOUT)!($D(DTOUT)) G BEGIN
  1. I 'Y G MLTDEL
  1. S TOTDUE=$$DUEARR^PRCARPU(.PLN) ;New total amount due
  1. S SUCCESS=$$INQPLAN^PRCARPU(TOTDUE,PLNDT)
  1. I 'SUCCESS W !! G BEGIN
  1. D RPDEL^PRCARPU(.PLN,0)
  1. D ADDPLAN^PRCARPU(.PLN,PRCAMT,PRCADAY,PRCAFPD,PRCADT,0)
  1. W !,"The Repayment Plan has been consolidated.",!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D ACCOUNTS^PRCARPU(+DEBTOR,.ALL,.PLN,.NON,.ACT) ;Reload accounts after change is filed
  1. I NON G EDITADD
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D PAYDISP^PRCARPU(+DEBTOR,PLNDT,.QUIT) I QUIT G BEGIN
  1. D CMTENTR^PRCARPU(+DEBTOR)
  1. D PAUSE^PRCARPU
  1. G BEGIN
  1. ;
  1. DELETE ;Delete a Repayment Plan
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. S SURE=$$CORRECT^PRCARPU()
  1. I '+SURE G BEGIN
  1. D RPDEL^PRCARPU(.PLN,1)
  1. W !!,"The Repayment Plan for "_$P(DEBTOR,U,2)_" has been Deleted.",!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D CMTENTR^PRCARPU(+DEBTOR)
  1. D PAUSE^PRCARPU
  1. G BEGIN
  1. ;
  1. EDITADD ;Edit a Repayment Plan with new bills
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. K DEL M DEL=PLN ;PRCA*4.5*340/DRF Always kill previous plan from bills
  1. D PAYDISP^PRCARPU(+DEBTOR,PLNDT,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. W !,"Bills not in Repayment Plan:",!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. S TOTAL=$$DISPLAY^PRCARPU(.NON,1,.QUIT) I QUIT G BEGIN
  1. I TOTAL=0 G NOBILLS
  1. K ADD
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. S LIST=$$SELECT^PRCARPU(.NON)
  1. I LIST="" W !," No Bills selected",! D PAUSE^PRCARPU G:QUIT BEGIN G NOBILLS
  1. D SUMM^PRCARPU(.NON,LIST,.ADD)
  1. S TOTDUE=$$DUEARR^PRCARPU(.ADD) ;Amount being added
  1. W !!,"Total amount chosen is $",$J(TOTDUE,8,2),!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. S SURE=$$CORRECT^PRCARPU()
  1. I 'SURE W !! G BEGIN
  1. D MERGE^PRCARPU(.PLN,.ADD)
  1. NOBILLS ;No new bill were chosen
  1. S TOTDUE=$$DUEARR^PRCARPU(.PLN) ;New total amount due
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. S SUCCESS=$$INQPLAN^PRCARPU(TOTDUE,PLNDT)
  1. I 'SUCCESS W !! G BEGIN
  1. D RPDEL^PRCARPU(.DEL,0)
  1. K DEL
  1. D ADDPLAN^PRCARPU(.PLN,PRCAMT,PRCADAY,PRCAFPD,PRCADT,0)
  1. I $G(ADD) D ADDTRAN^PRCARPU(.ADD) ;Add a 433 transaction entry to the new bills being added to the plan
  1. W !!,"The Repayment Plan has been updated.",!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. K ADD
  1. D ACCOUNTS^PRCARPU(+DEBTOR,.ALL,.PLN,.NON,.ACT) ;Reload accounts after change is filed
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D CMTENTR^PRCARPU(+DEBTOR)
  1. D PAUSE^PRCARPU
  1. G BEGIN
  1. ;
  1. EDIT ;Edit a Repayment Plan, no new bills
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. W !,"There are no new bills to be added.",!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D PAYDISP^PRCARPU(+DEBTOR,PLNDT,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. S SUCCESS=$$INQPLAN^PRCARPU(PLNTDUE,PLNDT)
  1. I 'SUCCESS W ! G BEGIN
  1. D RPDEL^PRCARPU(.PLN,0)
  1. D ADDPLAN^PRCARPU(.PLN,PRCAMT,PRCADAY,PRCAFPD,PRCADT,0)
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. W !,"The Repayment Plan has been updated.",!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D ACCOUNTS^PRCARPU(+DEBTOR,.ALL,.PLN,.NON,.ACT) ;Reload accounts after change is filed
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D CMTENTR^PRCARPU(+DEBTOR)
  1. D PAUSE^PRCARPU
  1. G BEGIN
  1. ;
  1. NOPLAN ;Debtor has no Repayment Plan
  1. W !,"This Debtor does not have a Repayment Plan",!!,"List of Active Bills:",!!
  1. S TOTAL=$$DISPLAY^PRCARPU(.NON,1,.QUIT) I QUIT G BEGIN
  1. S LIST=$$SELECT^PRCARPU(.NON)
  1. I LIST="" W !! G BEGIN
  1. D SUMM^PRCARPU(.NON,LIST,.ADD)
  1. S TOTDUE=$$DUEARR^PRCARPU(.ADD)
  1. W !!,"Total amount chosen is $",$J(TOTDUE,8,2),!
  1. S SURE=$$CORRECT^PRCARPU()
  1. I 'SURE W !! G BEGIN
  1. S SUCCESS=$$INQPLAN^PRCARPU(TOTDUE)
  1. I 'SUCCESS W !! G BEGIN
  1. D ADDPLAN^PRCARPU(.ADD,PRCAMT,PRCADAY,PRCAFPD,PRCADT,1)
  1. W !,"The Repayment Plan has been established.",!
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D ACCOUNTS^PRCARPU(+DEBTOR,.ALL,.PLN,.NON,.ACT) ;Reload accounts after change is filed
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D CMTENTR^PRCARPU(+DEBTOR)
  1. D PAUSE^PRCARPU
  1. G BEGIN
  1. ;
  1. MLTDEL ;Delete all multiple plans
  1. S DIR(0)="Y"
  1. S DIR("A")="Delete ALL current Repayment Plans for this Debtor"
  1. S DIR("?")="Enter Y to delete ALL current Repayment Plans"
  1. D ^DIR I $D(DUOUT)!($D(DTOUT)) G BEGIN
  1. I 'Y G BEGIN
  1. D RPDEL^PRCARPU(.PLN,1)
  1. W !,"All Repayment Plans have been deleted.",!
  1. D PAUSE^PRCARPU
  1. G BEGIN
  1. ;
  1. VIEW ;View a Repayment Plan
  1. D RPDIS^PRCARPU(DEBTOR,.PLN)
  1. S T=$$DISPLAY^PRCARPU(.PLN,0,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. D PAYDISP^PRCARPU(+DEBTOR,PLNDT,.QUIT) I QUIT G BEGIN
  1. D SCRNCHK^PRCARPU I QUIT G BEGIN
  1. W !,"Bills not in Repayment Plan:",!
  1. S TOTAL=$$DISPLAY^PRCARPU(.NON,1,.QUIT) I QUIT G BEGIN
  1. D PAUSE^PRCARPU
  1. G BEGIN