source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCBMILL2.m@ 1714

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

initial load of WorldVistAEHR

File size: 5.4 KB
Line 
1RCBMILL2 ;WISC/RFJ-millennium bill report (transactions) ; 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,DATE,HSIFBAL,RCBILLDA,RCDPDATA,RCTOTAL,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 S RCBILLDA=0 F S RCBILLDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA)) Q:'RCBILLDA!($G(RCRJFLAG)) D
18 . ;
19 . ; page break
20 . I $Y>(IOSL-3) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
21 . ;
22 . ; write bill data
23 . D DIQ430^RCDPBPLM(RCBILLDA,".01;8;")
24 . W !,"BILL: ",$P(RCDPDATA(430,RCBILLDA,.01,"E"),"-",2)
25 . W ?15,"STATUS: ",$E(RCDPDATA(430,RCBILLDA,8,"E"),1,7)
26 . K RCDPDATA(430,RCBILLDA)
27 . W ?30,"+------------+----------------------+-----------+"
28 . ;
29 . ; intialize totals for bill
30 . S RCTOTAL("PRINCIPAL")=0
31 . S RCTOTAL("TO MCCF")=0
32 . S RCTOTAL("TO HSIF")=0
33 . S RCTOTAL("TRANSFER TO HSIF")=0
34 . ;
35 . S RCTRANDA=0 F S RCTRANDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)) Q:'RCTRANDA!($G(RCRJFLAG)) D
36 . . ; data = type of transaction
37 . . ; principal amt of transaction
38 . . ; amount owed to mccf
39 . . ; amount owed to hsif
40 . . ; for payment, amount paid to mccf
41 . . ; for payment, amount paid to hsif
42 . . S DATA=^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)
43 . . ;
44 . . ; get the date and type of transaction
45 . . S DATA1=$G(^PRCA(433,RCTRANDA,1))
46 . . S DATE=$E($P(DATA1,"^",9),4,5)_"/"_$E($P(DATA1,"^",9),6,7)_"/"_$E($P(DATA1,"^",9),2,3)
47 . . S TYPE=$P(DATA1,"^",2)
48 . . S TYPE=$S(TYPE=1:"Increase",TYPE=35:"Decrease",TYPE=2:"Pay Part",TYPE=34:"Pay Full",43:"Re-estab",1:"Unknown")
49 . . ;
50 . . ; page break
51 . . I $Y>(IOSL-3) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
52 . . ;
53 . . ; write data
54 . . W !,RCTRANDA
55 . . W ?10,DATE
56 . . W ?20,TYPE
57 . . W ?30,"|"
58 . . W $J($P(DATA,"^",2),10,2)
59 . . W " |"
60 . . W $J($P(DATA,"^",3),10,2)
61 . . I $P(DATA,"^",4) W $J($P(DATA,"^",4),10,2)
62 . . W ?64," |"
63 . . ;
64 . . ; if it is a payment transaction, show if there is a
65 . . ; balance owed to hsif
66 . . S HSIFBAL=0
67 . . I $P(DATA1,"^",2)=2!($P(DATA1,"^",2)=34) D
68 . . . ; get the amount owed to hsif based on what has been paid
69 . . . S HSIFBAL=$P(DATA,"^",4)+$P(DATA,"^",6)
70 . . . I HSIFBAL W $J(-HSIFBAL,10,2)
71 . . . I 'HSIFBAL,$P(DATA,"^",6) W $J("paid",10)
72 . . . ;
73 . . . ; compute totals paid for selected report month
74 . . . ; payment dollars are recorded in data as minus
75 . . . I $E($P(DATA1,"^",9),1,5)'=$E(RCDATBEG,1,5) Q
76 . . . S RCTOTALM("TO MCCF")=RCTOTALM("TO MCCF")-$P(DATA,"^",3)
77 . . . S RCTOTALM("TO HSIF")=RCTOTALM("TO HSIF")-$P(DATA,"^",4)
78 . . . S RCTOTALM("PAID TO HSIF")=RCTOTALM("PAID TO HSIF")+$P(DATA,"^",6)
79 . . ;
80 . . W ?78,"|"
81 . . ;
82 . . ; store totals by bill
83 . . S RCTOTAL("PRINCIPAL")=RCTOTAL("PRINCIPAL")+$P(DATA,"^",2)
84 . . S RCTOTAL("TO MCCF")=RCTOTAL("TO MCCF")+$P(DATA,"^",3)
85 . . S RCTOTAL("TO HSIF")=RCTOTAL("TO HSIF")+$P(DATA,"^",4)
86 . . S RCTOTAL("TRANSFER TO HSIF")=RCTOTAL("TRANSFER TO HSIF")+HSIFBAL
87 . ;
88 . ; page break
89 . I $G(RCRJFLAG) Q
90 . I $Y>(IOSL-4) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
91 . ;
92 . ; show totals by each bill
93 . W !?30,"+------------+----------------------+-----------+"
94 . W !?20,"BALANCES"
95 . W ?31,$J(RCTOTAL("PRINCIPAL"),10,2)
96 . W " "
97 . W $J(RCTOTAL("TO MCCF"),10,2)
98 . W $J(RCTOTAL("TO HSIF"),10,2)
99 . W " |"
100 . W $J(-RCTOTAL("TRANSFER TO HSIF"),10,2)
101 . W ?78,"|"
102 ;
103 I $G(RCRJFLAG) Q
104 ;
105 I $O(^TMP($J,"RCBMILLDATA",0)) W !?66,"+-----------+"
106 ;
107 ; page break
108 I $G(RCRJFLAG) Q
109 I $Y>(IOSL-9) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
110 ;
111TOTALS ; show monthly totals (called by the other reports)
112 ;
113 W !,"+=============================================================================+"
114 W !,"|",?2,"TOTAL RX-COPAYMENTS FOR MONTH: ",$J(RCMOYR,10),?78,"|"
115 W !,"|",?2," SPLIT PAID TO MCCF: ",$J(RCTOTALM("TO MCCF"),10,2),?78,"|"
116 W !,"|",?2," SPLIT PAID TO HSIF: ",$J(RCTOTALM("TO HSIF"),10,2),?78,"|"
117 W !,"|",?45,"ALREADY PAID TO HSIF: ",$J(RCTOTALM("PAID TO HSIF"),10,2),?78,"|"
118 W !,"|",?45,"BALANCE OWED TO HSIF: ",$J(RCTOTALM("TO HSIF")-RCTOTALM("PAID TO HSIF"),10,2),?78,"|"
119 W !,"|",?2," ",$J("----------",10),?78,"|"
120 W !,"|",?2," TOTAL RX-COPAYMENTS RECEIVED: ",$J(RCTOTALM("TO MCCF")+RCTOTALM("TO HSIF"),10,2),?78,"|"
121 W !,"+=============================================================================+"
122 Q
123 ;
124 ;
125H ; print heading
126 S %=RCNOW_" PAGE "_RCPAGE,RCPAGE=RCPAGE+1 I RCPAGE'=2!(RCSCREEN) W @IOF
127 W $C(13),"PAYMENTS SPLIT TO HSIF/MCCF REPORT",?(79-$L(%)),%
128 ;
129 W !," FOR THE MONTH/YEAR: ",RCMOYR
130 W ?30,"+------------+----------------------+-----------+"
131 ;
132 W !?30,"|"
133 W $J("PRINCIP",10)
134 W " |"
135 W $J("FUND SPLIT",16)
136 W " |"
137 W $J("TRANSFER",10)
138 W ?78,"|"
139 ;
140 W !,"TRANS #"
141 W ?10,"PROCDATE"
142 W ?20,"TYPE"
143 W ?30,"|"
144 W $J("AMOUNT",10)
145 W " |"
146 W $J("TO MCCF",10)
147 W $J("TO HSIF",10)
148 W " |"
149 W $J("TO HSIF",10)
150 W ?78,"|"
151 ;
152 W !,"------------------------------+------------+----------------------+-----------+"
153 Q
Note: See TracBrowser for help on using the repository browser.