source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCBMILL1.m@ 1306

Last change on this file since 1306 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1RCBMILL1 ;WISC/RFJ-millennium bill report (payment detail) ; 27 Jun 2001 11:10 AM
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 ;
7PRINT ; print report
8 N DATA,DATA1,HSIFBAL,RCBILLDA,RCTOTALM,RCTRANDA,TYPE
9 ;
10 U IO D H
11 ;
12 ; intialize totals for month
13 S RCTOTALM("TO MCCF")=0
14 S RCTOTALM("TO HSIF")=0
15 S RCTOTALM("PAID TO HSIF")=0
16 ;
17 ; loop the bills with payments
18 S RCBILLDA=0 F S RCBILLDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA)) Q:'RCBILLDA!($G(RCRJFLAG)) D
19 . ;
20 . ; loop the transactions
21 . S RCTRANDA=0 F S RCTRANDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)) Q:'RCTRANDA!($G(RCRJFLAG)) D
22 . . ; data = type of transaction
23 . . ; principal amt of transaction
24 . . ; amount owed to mccf
25 . . ; amount owed to hsif
26 . . ; for payment, amount paid to mccf
27 . . ; for payment, amount paid to hsif
28 . . S DATA=^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)
29 . . ;
30 . . ; get the type of transaction
31 . . S DATA1=$G(^PRCA(433,RCTRANDA,1))
32 . . S TYPE=$P(DATA1,"^",2)
33 . . S TYPE=$S(TYPE=1:"Increase",TYPE=35:"Decrease",TYPE=2:"Pay Part",TYPE=34:"Pay Full",1:"Unknown")
34 . . ;
35 . . S HSIFBAL=0
36 . . ;
37 . . ; write data
38 . . I $E(TYPE)="P" D
39 . . . ; only print payments for the selected month
40 . . . I $E($P(DATA1,"^",9),1,5)'=$E(RCDATBEG,1,5) Q
41 . . . ;
42 . . . ; page break
43 . . . I $Y>(IOSL-3) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
44 . . . ;
45 . . . W !,$P($P(^PRCA(430,RCBILLDA,0),"^"),"-",2)
46 . . . W ?10,RCTRANDA
47 . . . W ?20,TYPE
48 . . . W ?30,"|"
49 . . . W $J($P(DATA,"^",2),10,2)
50 . . . W " |"
51 . . . W $J($P(DATA,"^",3),10,2)
52 . . . I $P(DATA,"^",4) W $J($P(DATA,"^",4),10,2)
53 . . . W ?64," |"
54 . . . ;
55 . . . ; show if balance owed to hsif
56 . . . ; get the amount owed to hsif based on what has been paid
57 . . . S HSIFBAL=$P(DATA,"^",4)+$P(DATA,"^",6)
58 . . . I HSIFBAL W $J(-HSIFBAL,10,2)
59 . . . I 'HSIFBAL,$P(DATA,"^",6) W $J("paid",10)
60 . . . ;
61 . . . W ?78,"|"
62 . . . ;
63 . . . ; compute totals paid for selected report month
64 . . . ; payment dollars are recorded in data as minus
65 . . . S RCTOTALM("TO MCCF")=RCTOTALM("TO MCCF")-$P(DATA,"^",3)
66 . . . S RCTOTALM("TO HSIF")=RCTOTALM("TO HSIF")-$P(DATA,"^",4)
67 . . . S RCTOTALM("PAID TO HSIF")=RCTOTALM("PAID TO HSIF")+$P(DATA,"^",6)
68 ;
69 I $G(RCRJFLAG) Q
70 ;
71 ; page break
72 I $Y>(IOSL-9) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
73 ;
74 ; show totals for the month
75 D TOTALS^RCBMILL2
76 Q
77 ;
78 ;
79H ; print heading
80 S %=RCNOW_" PAGE "_RCPAGE,RCPAGE=RCPAGE+1 I RCPAGE'=2!(RCSCREEN) W @IOF
81 W $C(13),"PAYMENTS SPLIT TO HSIF/MCCF REPORT",?(79-$L(%)),%
82 ;
83 W !," FOR THE MONTH/YEAR: ",RCMOYR
84 W ?30,"+------------+----------------------+-----------+"
85 ;
86 W !?30,"|"
87 W $J("PRINCIP",10)
88 W " |"
89 W $J("FUND SPLIT",18)
90 W " |"
91 W $J("TRANSFER",10)
92 W ?78,"|"
93 ;
94 W !,"BILL #"
95 W ?10,"TRAN #"
96 W ?20,"TYPE"
97 W ?30,"|"
98 W $J("AMOUNT",10)
99 W " |"
100 W $J("TO MCCF",10)
101 W $J("TO HSIF",10)
102 W " |"
103 W $J("TO HSIF",10)
104 W ?78,"|"
105 ;
106 W !,"------------------------------+------------+----------------------+-----------+"
107 Q
Note: See TracBrowser for help on using the repository browser.