| [613] | 1 | RCBMILLT ;WISC/RFJ-millennium bill (get TR data) ;1 Oct 01
|
|---|
| 2 | ;;4.5;Accounts Receivable;**170**;Mar 20, 1995
|
|---|
| 3 | ;;Per VHA Directive 10-93-142, this routine should not be modified.
|
|---|
| 4 | Q
|
|---|
| 5 | ;
|
|---|
| 6 | ;
|
|---|
| 7 | GETPAY(RCDATEND) ; get payments for the month
|
|---|
| 8 | ; returns rctrans(fromfund,fromrsc) = tofund ^ torsc ^ amount to transfer
|
|---|
| 9 | ; fromfund is 5287 and tofund is 5358.1
|
|---|
| 10 | ;
|
|---|
| 11 | N DATA,RCBILLDA,RCRSC,RCTOTAL,RCTRANDA,TORCRSC
|
|---|
| 12 | ;
|
|---|
| 13 | S RCBILLDA=0 F S RCBILLDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA)) Q:'RCBILLDA D
|
|---|
| 14 | . ; get the rsc for the bill
|
|---|
| 15 | . S RCRSC=$$CALCRSC^RCXFMSUR(RCBILLDA)
|
|---|
| 16 | . ;
|
|---|
| 17 | . S RCTRANDA=0 F S RCTRANDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)) Q:'RCTRANDA D
|
|---|
| 18 | . . ;
|
|---|
| 19 | . . ; data piece 1 = type of transaction (1 letter)
|
|---|
| 20 | . . ; data piece 2 = principal amt of transaction
|
|---|
| 21 | . . ; data piece 3 = amount owed to mccf
|
|---|
| 22 | . . ; data piece 4 = amount owed to hsif
|
|---|
| 23 | . . ; data piece 5 = for payment, amount already paid to mccf
|
|---|
| 24 | . . ; data piece 6 = for payment, amount already paid to hsif
|
|---|
| 25 | . . S DATA=^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)
|
|---|
| 26 | . . ;
|
|---|
| 27 | . . ; only count payments
|
|---|
| 28 | . . I $E(DATA)'="P" Q
|
|---|
| 29 | . . ;
|
|---|
| 30 | . . ; only report the transfer if the payment was during the
|
|---|
| 31 | . . ; current month
|
|---|
| 32 | . . I +$E($P($G(^PRCA(433,RCTRANDA,1)),"^",9),1,5)'=+$E(RCDATEND,1,5) Q
|
|---|
| 33 | . . ;
|
|---|
| 34 | . . ; total the amount to transfer to hsif
|
|---|
| 35 | . . ; (payment value is stored as a minus)
|
|---|
| 36 | . . S RCTOTAL(RCRSC)=$G(RCTOTAL(RCRSC))-$P(DATA,"^",4)
|
|---|
| 37 | ;
|
|---|
| 38 | ; put dollars in rctrans(fromfund,fromrsc) = tofund ^ torsc ^ amount
|
|---|
| 39 | K RCTRANS
|
|---|
| 40 | S RCRSC="" F S RCRSC=$O(RCTOTAL(RCRSC)) Q:RCRSC="" D
|
|---|
| 41 | . ; if the rsc for the bill is 8BZZ, transfer to 8B1Z
|
|---|
| 42 | . ; if the rsc for the bill is 8CZZ, transfer to 8C1Z
|
|---|
| 43 | . I RCRSC="8BZZ" S TORCRSC="8B1Z"
|
|---|
| 44 | . I RCRSC="8CZZ" S TORCRSC="8C1Z"
|
|---|
| 45 | . I RCTOTAL(RCRSC) S RCTRANS(5287,RCRSC)="5358.1^"_TORCRSC_"^"_RCTOTAL(RCRSC)
|
|---|
| 46 | Q
|
|---|
| 47 | ;
|
|---|
| 48 | ;
|
|---|
| 49 | SETPAY(RCDATEND) ; set payments for the month
|
|---|
| 50 | ; this call will set the 433 transaction showing the dollars
|
|---|
| 51 | ; transferred to hsif on the payment (fields 91 and 92)
|
|---|
| 52 | ;
|
|---|
| 53 | N DATA,RCBILLDA,RCTRANDA
|
|---|
| 54 | ;
|
|---|
| 55 | S RCBILLDA=0 F S RCBILLDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA)) Q:'RCBILLDA D
|
|---|
| 56 | . ;
|
|---|
| 57 | . S RCTRANDA=0 F S RCTRANDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)) Q:'RCTRANDA D
|
|---|
| 58 | . . ;
|
|---|
| 59 | . . ; data piece 1 = type of transaction (1 letter)
|
|---|
| 60 | . . ; data piece 2 = principal amt of transaction
|
|---|
| 61 | . . ; data piece 3 = amount owed to mccf
|
|---|
| 62 | . . ; data piece 4 = amount owed to hsif
|
|---|
| 63 | . . ; data piece 5 = for payment, amount already paid to mccf
|
|---|
| 64 | . . ; data piece 6 = for payment, amount already paid to hsif
|
|---|
| 65 | . . S DATA=^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)
|
|---|
| 66 | . . ;
|
|---|
| 67 | . . ; only count payments
|
|---|
| 68 | . . I $E(DATA)'="P" Q
|
|---|
| 69 | . . ;
|
|---|
| 70 | . . ; only report the transfer if the payment was during the
|
|---|
| 71 | . . ; current month
|
|---|
| 72 | . . I +$E($P($G(^PRCA(433,RCTRANDA,1)),"^",9),1,5)'=+$E(RCDATEND,1,5) Q
|
|---|
| 73 | . . ;
|
|---|
| 74 | . . ; set as paid
|
|---|
| 75 | . . S $P(^PRCA(433,RCTRANDA,9),"^",1,2)=(-$P(DATA,"^",3))_"^"_(-$P(DATA,"^",4))
|
|---|
| 76 | Q
|
|---|