RCBMILL1 ;WISC/RFJ-millennium bill report (payment detail) ; 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
;
;
PRINT ; print report
N DATA,DATA1,HSIFBAL,RCBILLDA,RCTOTALM,RCTRANDA,TYPE
;
U IO D H
;
; intialize totals for month
S RCTOTALM("TO MCCF")=0
S RCTOTALM("TO HSIF")=0
S RCTOTALM("PAID TO HSIF")=0
;
; loop the bills with payments
S RCBILLDA=0 F S RCBILLDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA)) Q:'RCBILLDA!($G(RCRJFLAG)) D
. ;
. ; loop the transactions
. S RCTRANDA=0 F S RCTRANDA=$O(^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)) Q:'RCTRANDA!($G(RCRJFLAG)) D
. . ; data = type of transaction
. . ; principal amt of transaction
. . ; amount owed to mccf
. . ; amount owed to hsif
. . ; for payment, amount paid to mccf
. . ; for payment, amount paid to hsif
. . S DATA=^TMP($J,"RCBMILLDATA",RCBILLDA,RCTRANDA)
. . ;
. . ; get the type of transaction
. . S DATA1=$G(^PRCA(433,RCTRANDA,1))
. . S TYPE=$P(DATA1,"^",2)
. . S TYPE=$S(TYPE=1:"Increase",TYPE=35:"Decrease",TYPE=2:"Pay Part",TYPE=34:"Pay Full",1:"Unknown")
. . ;
. . S HSIFBAL=0
. . ;
. . ; write data
. . I $E(TYPE)="P" D
. . . ; only print payments for the selected month
. . . I $E($P(DATA1,"^",9),1,5)'=$E(RCDATBEG,1,5) Q
. . . ;
. . . ; page break
. . . I $Y>(IOSL-3) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
. . . ;
. . . W !,$P($P(^PRCA(430,RCBILLDA,0),"^"),"-",2)
. . . W ?10,RCTRANDA
. . . W ?20,TYPE
. . . W ?30,"|"
. . . W $J($P(DATA,"^",2),10,2)
. . . W " |"
. . . W $J($P(DATA,"^",3),10,2)
. . . I $P(DATA,"^",4) W $J($P(DATA,"^",4),10,2)
. . . W ?64," |"
. . . ;
. . . ; show if balance owed to hsif
. . . ; get the amount owed to hsif based on what has been paid
. . . S HSIFBAL=$P(DATA,"^",4)+$P(DATA,"^",6)
. . . I HSIFBAL W $J(-HSIFBAL,10,2)
. . . I 'HSIFBAL,$P(DATA,"^",6) W $J("paid",10)
. . . ;
. . . W ?78,"|"
. . . ;
. . . ; compute totals paid for selected report month
. . . ; payment dollars are recorded in data as minus
. . . S RCTOTALM("TO MCCF")=RCTOTALM("TO MCCF")-$P(DATA,"^",3)
. . . S RCTOTALM("TO HSIF")=RCTOTALM("TO HSIF")-$P(DATA,"^",4)
. . . S RCTOTALM("PAID TO HSIF")=RCTOTALM("PAID TO HSIF")+$P(DATA,"^",6)
;
I $G(RCRJFLAG) Q
;
; page break
I $Y>(IOSL-9) D:RCSCREEN PAUSE^RCRJRTR1 Q:$G(RCRJFLAG) D H
;
; show totals for the month
D TOTALS^RCBMILL2
Q
;
;
H ; print heading
S %=RCNOW_" PAGE "_RCPAGE,RCPAGE=RCPAGE+1 I RCPAGE'=2!(RCSCREEN) W @IOF
W $C(13),"PAYMENTS SPLIT TO HSIF/MCCF REPORT",?(79-$L(%)),%
;
W !," FOR THE MONTH/YEAR: ",RCMOYR
W ?30,"+------------+----------------------+-----------+"
;
W !?30,"|"
W $J("PRINCIP",10)
W " |"
W $J("FUND SPLIT",18)
W " |"
W $J("TRANSFER",10)
W ?78,"|"
;
W !,"BILL #"
W ?10,"TRAN #"
W ?20,"TYPE"
W ?30,"|"
W $J("AMOUNT",10)
W " |"
W $J("TO MCCF",10)
W $J("TO HSIF",10)
W " |"
W $J("TO HSIF",10)
W ?78,"|"
;
W !,"------------------------------+------------+----------------------+-----------+"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCBMILL1 3465 printed Nov 22, 2024@16:53:11 Page 2
RCBMILL1 ;WISC/RFJ-millennium bill report (payment detail) ; 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 ;
PRINT ; print report
+1 NEW DATA,DATA1,HSIFBAL,RCBILLDA,RCTOTALM,RCTRANDA,TYPE
+2 ;
+3 USE IO
DO H
+4 ;
+5 ; intialize totals for month
+6 SET RCTOTALM("TO MCCF")=0
+7 SET RCTOTALM("TO HSIF")=0
+8 SET RCTOTALM("PAID TO HSIF")=0
+9 ;
+10 ; loop the bills with payments
+11 SET RCBILLDA=0
FOR
SET RCBILLDA=$ORDER(^TMP($JOB,"RCBMILLDATA",RCBILLDA))
if 'RCBILLDA!($GET(RCRJFLAG))
QUIT
Begin DoDot:1
+12 ;
+13 ; loop the transactions
+14 SET RCTRANDA=0
FOR
SET RCTRANDA=$ORDER(^TMP($JOB,"RCBMILLDATA",RCBILLDA,RCTRANDA))
if 'RCTRANDA!($GET(RCRJFLAG))
QUIT
Begin DoDot:2
+15 ; data = type of transaction
+16 ; principal amt of transaction
+17 ; amount owed to mccf
+18 ; amount owed to hsif
+19 ; for payment, amount paid to mccf
+20 ; for payment, amount paid to hsif
+21 SET DATA=^TMP($JOB,"RCBMILLDATA",RCBILLDA,RCTRANDA)
+22 ;
+23 ; get the type of transaction
+24 SET DATA1=$GET(^PRCA(433,RCTRANDA,1))
+25 SET TYPE=$PIECE(DATA1,"^",2)
+26 SET TYPE=$SELECT(TYPE=1:"Increase",TYPE=35:"Decrease",TYPE=2:"Pay Part",TYPE=34:"Pay Full",1:"Unknown")
+27 ;
+28 SET HSIFBAL=0
+29 ;
+30 ; write data
+31 IF $EXTRACT(TYPE)="P"
Begin DoDot:3
+32 ; only print payments for the selected month
+33 IF $EXTRACT($PIECE(DATA1,"^",9),1,5)'=$EXTRACT(RCDATBEG,1,5)
QUIT
+34 ;
+35 ; page break
+36 IF $Y>(IOSL-3)
if RCSCREEN
DO PAUSE^RCRJRTR1
if $GET(RCRJFLAG)
QUIT
DO H
+37 ;
+38 WRITE !,$PIECE($PIECE(^PRCA(430,RCBILLDA,0),"^"),"-",2)
+39 WRITE ?10,RCTRANDA
+40 WRITE ?20,TYPE
+41 WRITE ?30,"|"
+42 WRITE $JUSTIFY($PIECE(DATA,"^",2),10,2)
+43 WRITE " |"
+44 WRITE $JUSTIFY($PIECE(DATA,"^",3),10,2)
+45 IF $PIECE(DATA,"^",4)
WRITE $JUSTIFY($PIECE(DATA,"^",4),10,2)
+46 WRITE ?64," |"
+47 ;
+48 ; show if balance owed to hsif
+49 ; get the amount owed to hsif based on what has been paid
+50 SET HSIFBAL=$PIECE(DATA,"^",4)+$PIECE(DATA,"^",6)
+51 IF HSIFBAL
WRITE $JUSTIFY(-HSIFBAL,10,2)
+52 IF 'HSIFBAL
IF $PIECE(DATA,"^",6)
WRITE $JUSTIFY("paid",10)
+53 ;
+54 WRITE ?78,"|"
+55 ;
+56 ; compute totals paid for selected report month
+57 ; payment dollars are recorded in data as minus
+58 SET RCTOTALM("TO MCCF")=RCTOTALM("TO MCCF")-$PIECE(DATA,"^",3)
+59 SET RCTOTALM("TO HSIF")=RCTOTALM("TO HSIF")-$PIECE(DATA,"^",4)
+60 SET RCTOTALM("PAID TO HSIF")=RCTOTALM("PAID TO HSIF")+$PIECE(DATA,"^",6)
End DoDot:3
End DoDot:2
End DoDot:1
+61 ;
+62 IF $GET(RCRJFLAG)
QUIT
+63 ;
+64 ; page break
+65 IF $Y>(IOSL-9)
if RCSCREEN
DO PAUSE^RCRJRTR1
if $GET(RCRJFLAG)
QUIT
DO H
+66 ;
+67 ; show totals for the month
+68 DO TOTALS^RCBMILL2
+69 QUIT
+70 ;
+71 ;
H ; print heading
+1 SET %=RCNOW_" PAGE "_RCPAGE
SET RCPAGE=RCPAGE+1
IF RCPAGE'=2!(RCSCREEN)
WRITE @IOF
+2 WRITE $CHAR(13),"PAYMENTS SPLIT TO HSIF/MCCF REPORT",?(79-$LENGTH(%)),%
+3 ;
+4 WRITE !," FOR THE MONTH/YEAR: ",RCMOYR
+5 WRITE ?30,"+------------+----------------------+-----------+"
+6 ;
+7 WRITE !?30,"|"
+8 WRITE $JUSTIFY("PRINCIP",10)
+9 WRITE " |"
+10 WRITE $JUSTIFY("FUND SPLIT",18)
+11 WRITE " |"
+12 WRITE $JUSTIFY("TRANSFER",10)
+13 WRITE ?78,"|"
+14 ;
+15 WRITE !,"BILL #"
+16 WRITE ?10,"TRAN #"
+17 WRITE ?20,"TYPE"
+18 WRITE ?30,"|"
+19 WRITE $JUSTIFY("AMOUNT",10)
+20 WRITE " |"
+21 WRITE $JUSTIFY("TO MCCF",10)
+22 WRITE $JUSTIFY("TO HSIF",10)
+23 WRITE " |"
+24 WRITE $JUSTIFY("TO HSIF",10)
+25 WRITE ?78,"|"
+26 ;
+27 WRITE !,"------------------------------+------------+----------------------+-----------+"
+28 QUIT