RCBMILLD ;WISC/RFJ-millennium bill (calculations internal set tmp) ; 27 Jun 2001 11:10 AM
;;4.5;Accounts Receivable;**170**;Mar 20, 1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
Q
;
;
SETTEMP(TYPE,PRINCPAL,AMTOMCCF,AMTOHSIF,PAIDMCCF,PAIDHSIF) ; build the temp global
; called internally by the routine rcbmillc
;
; type = type of transaction
; princpal = principal amount of transaction
; amtomccf = expected amount calculated going to mccf
; amtohsif = expected amount calculated going to hsif
; paidmccf = amount already paid to mccf for the payment
; paidhsif = amount already paid to hsif for the payment
;
; if not a payment, set running balance of what is owed to mccf and hsif
I TYPE'="P" D
. S RCTOTAL("OWED TO MCCF")=RCTOTAL("OWED TO MCCF")+AMTOMCCF("BEFORE EFF DATE")+AMTOMCCF("AFTER EFF DATE")
. S RCTOTAL("OWED TO HSIF")=RCTOTAL("OWED TO HSIF")+AMTOHSIF
;
; if a payment, add amount paid to mccf and hsif
I TYPE="P" D
. S RCTOTAL("PAID TO MCCF")=RCTOTAL("PAID TO MCCF")+AMTOMCCF("BEFORE EFF DATE")+AMTOMCCF("AFTER EFF DATE")
. S RCTOTAL("PAID TO HSIF")=RCTOTAL("PAID TO HSIF")+AMTOHSIF
;
; build total owed to hsif for bill
S RCBALANC("HSIF")=RCBALANC("HSIF")+AMTOHSIF
;
; build total owed to mccf for bill
S RCBALANC("MCCF BEFORE EFF DATE")=RCBALANC("MCCF BEFORE EFF DATE")+AMTOMCCF("BEFORE EFF DATE")
S RCBALANC("MCCF AFTER EFF DATE")=RCBALANC("MCCF AFTER EFF DATE")+AMTOMCCF("AFTER EFF DATE")
;
; build a tmp array of increase and decrease adjustment transactions
; set tmp = transaction type 'D'ecrease or 'I"ncrease
; principal amount of transaction
; amount owed to mccf
; amount owed to hsif
; for payment, amount already paid to mccf
; for payment, amount already paid to hsif
S ^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)=TYPE_"^"_PRINCPAL_"^"_(AMTOMCCF("BEFORE EFF DATE")+AMTOMCCF("AFTER EFF DATE"))_"^"_AMTOHSIF_"^"_$G(PAIDMCCF)_"^"_$G(PAIDHSIF)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCBMILLD 2054 printed Oct 16, 2024@17:43:54 Page 2
RCBMILLD ;WISC/RFJ-millennium bill (calculations internal set tmp) ; 27 Jun 2001 11:10 AM
+1 ;;4.5;Accounts Receivable;**170**;Mar 20, 1995
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 QUIT
+4 ;
+5 ;
SETTEMP(TYPE,PRINCPAL,AMTOMCCF,AMTOHSIF,PAIDMCCF,PAIDHSIF) ; build the temp global
+1 ; called internally by the routine rcbmillc
+2 ;
+3 ; type = type of transaction
+4 ; princpal = principal amount of transaction
+5 ; amtomccf = expected amount calculated going to mccf
+6 ; amtohsif = expected amount calculated going to hsif
+7 ; paidmccf = amount already paid to mccf for the payment
+8 ; paidhsif = amount already paid to hsif for the payment
+9 ;
+10 ; if not a payment, set running balance of what is owed to mccf and hsif
+11 IF TYPE'="P"
Begin DoDot:1
+12 SET RCTOTAL("OWED TO MCCF")=RCTOTAL("OWED TO MCCF")+AMTOMCCF("BEFORE EFF DATE")+AMTOMCCF("AFTER EFF DATE")
+13 SET RCTOTAL("OWED TO HSIF")=RCTOTAL("OWED TO HSIF")+AMTOHSIF
End DoDot:1
+14 ;
+15 ; if a payment, add amount paid to mccf and hsif
+16 IF TYPE="P"
Begin DoDot:1
+17 SET RCTOTAL("PAID TO MCCF")=RCTOTAL("PAID TO MCCF")+AMTOMCCF("BEFORE EFF DATE")+AMTOMCCF("AFTER EFF DATE")
+18 SET RCTOTAL("PAID TO HSIF")=RCTOTAL("PAID TO HSIF")+AMTOHSIF
End DoDot:1
+19 ;
+20 ; build total owed to hsif for bill
+21 SET RCBALANC("HSIF")=RCBALANC("HSIF")+AMTOHSIF
+22 ;
+23 ; build total owed to mccf for bill
+24 SET RCBALANC("MCCF BEFORE EFF DATE")=RCBALANC("MCCF BEFORE EFF DATE")+AMTOMCCF("BEFORE EFF DATE")
+25 SET RCBALANC("MCCF AFTER EFF DATE")=RCBALANC("MCCF AFTER EFF DATE")+AMTOMCCF("AFTER EFF DATE")
+26 ;
+27 ; build a tmp array of increase and decrease adjustment transactions
+28 ; set tmp = transaction type 'D'ecrease or 'I"ncrease
+29 ; principal amount of transaction
+30 ; amount owed to mccf
+31 ; amount owed to hsif
+32 ; for payment, amount already paid to mccf
+33 ; for payment, amount already paid to hsif
+34 SET ^TMP($JOB,"RCBMILLDATA",RCBILLDA,RCTRANDA)=TYPE_"^"_PRINCPAL_"^"_(AMTOMCCF("BEFORE EFF DATE")+AMTOMCCF("AFTER EFF DATE"))_"^"_AMTOHSIF_"^"_$GET(PAIDMCCF)_"^"_$GET(PAIDHSIF)
+35 QUIT