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

RCBEPAY1.m

Go to the documentation of this file.
  1. RCBEPAY1 ;WISC/RFJ-create a payment transaction cont ;1 Jun 00
  1. ;;4.5;Accounts Receivable;**153**;Mar 20, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. PAYTRAN(RCBILLDA,RCPAYAMT,RCRECTDA,RCPAYDA,RCPAYDAT) ; create the payment
  1. ; transaction for a bill.
  1. ; return 433 ien transaction if payment made
  1. ; or 0^error if not processed.
  1. ; input variables:
  1. ; rcbillda = ien of bill to apply payment to
  1. ; rcpayamt = total payment transaction amount
  1. ; rcrectda = ien of receipt in file 344
  1. ; rcpayda = payment transaction number in file 344.01
  1. ; rcpaydat = date of payment
  1. ; note: rcrectda and rcpayda are passed as zero if posting from
  1. ; a prepayment bill
  1. ;
  1. N RCDATA7,RCPAY,RCTRANDA
  1. ;
  1. ; determine how payment should be applied
  1. S RCDATA7=^PRCA(430,RCBILLDA,7)
  1. ; === check marshal fee balance and apply payment ===
  1. I $P(RCDATA7,"^",4)>0 D
  1. . ; if the payment amount is less than mf charge
  1. . ; apply all the payment to the mf charge and quit
  1. . I RCPAYAMT<$P(RCDATA7,"^",4) D Q
  1. . . S RCPAY("MF")=RCPAYAMT
  1. . . S RCPAYAMT=0
  1. . ; otherwise, apply payment to make the mf balance 0
  1. . S RCPAY("MF")=$P(RCDATA7,"^",4)
  1. . S RCPAYAMT=RCPAYAMT-$P(RCDATA7,"^",4)
  1. ; no payment amount remaining
  1. I 'RCPAYAMT D SET^RCBEPAY2 Q RCTRANDA
  1. ;
  1. ; === check court cost balance and apply payment ===
  1. I $P(RCDATA7,"^",5)>0 D
  1. . ; if the payment amount is less than cc charge
  1. . ; apply all the payment to the cc charge and quit
  1. . I RCPAYAMT<$P(RCDATA7,"^",5) D Q
  1. . . S RCPAY("CC")=RCPAYAMT
  1. . . S RCPAYAMT=0
  1. . ; otherwise, apply payment to make the cc balance 0
  1. . S RCPAY("CC")=$P(RCDATA7,"^",5)
  1. . S RCPAYAMT=RCPAYAMT-$P(RCDATA7,"^",5)
  1. ; no payment amount remaining
  1. I 'RCPAYAMT D SET^RCBEPAY2 Q RCTRANDA
  1. ;
  1. ; === check admin balance and apply payment ===
  1. I $P(RCDATA7,"^",3)>0 D
  1. . ; if the payment amount is less than admin charge
  1. . ; apply all the payment to the admin charge and quit
  1. . I RCPAYAMT<$P(RCDATA7,"^",3) D Q
  1. . . S RCPAY("ADM")=RCPAYAMT
  1. . . S RCPAYAMT=0
  1. . ; otherwise, apply payment to make the admin balance 0
  1. . S RCPAY("ADM")=$P(RCDATA7,"^",3)
  1. . S RCPAYAMT=RCPAYAMT-$P(RCDATA7,"^",3)
  1. ; no payment amount remaining
  1. I 'RCPAYAMT D SET^RCBEPAY2 Q RCTRANDA
  1. ;
  1. ; === check interest balance and apply payment ===
  1. I $P(RCDATA7,"^",2)>0 D
  1. . ; if the payment amount is less than interest charge
  1. . ; apply all the payment to the interest charge and quit
  1. . I RCPAYAMT<$P(RCDATA7,"^",2) D Q
  1. . . S RCPAY("INT")=RCPAYAMT
  1. . . S RCPAYAMT=0
  1. . ; otherwise, apply payment to make the interest balance 0
  1. . S RCPAY("INT")=$P(RCDATA7,"^",2)
  1. . S RCPAYAMT=RCPAYAMT-$P(RCDATA7,"^",2)
  1. ; no payment amount remaining
  1. I 'RCPAYAMT D SET^RCBEPAY2 Q RCTRANDA
  1. ;
  1. ; === check principal balance and apply payment ===
  1. I $P(RCDATA7,"^",1)>0 D
  1. . ; if the payment amount is less than principal charge
  1. . ; apply all the payment to the principal charge and quit
  1. . I RCPAYAMT<$P(RCDATA7,"^",1) D Q
  1. . . S RCPAY("PRIN")=RCPAYAMT
  1. . . S RCPAYAMT=0
  1. . ; otherwise, apply payment to make the principal balance 0
  1. . S RCPAY("PRIN")=$P(RCDATA7,"^",1)
  1. . S RCPAYAMT=RCPAYAMT-$P(RCDATA7,"^",1)
  1. ;
  1. D SET^RCBEPAY2
  1. Q RCTRANDA