PRCAI16M ;ALB/LDB-post init patch 164, generate mail message ;19 Nov 00
;;4.5;Accounts Receivable;**164**;Mar 20, 1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
Q
;
;
MAIL ; generate mail message to users
; rcmessag variable passed as to the status of the patch install.
; this variable appears on the first line of the message.
D MES^XPDUTL(" ...generating mailman message to G.RCDP PAYMENTS.")
;
N %,COUNT,DATA,DATE,LINE,PPBILL,PPTRAN1,PPTRANS,RCBILLDA,RCTRAN1,RCTRANDA,TOTAL,TYPE,XMDUN,XMY,XMZ
;
; generate mailman message to user
K ^TMP($J,"RCRJRCORMM")
S ^TMP($J,"RCRJRCORMM",1)=RCMESSAG
S ^TMP($J,"RCRJRCORMM",2)=" "
S ^TMP($J,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for deposit"
S ^TMP($J,"RCRJRCORMM",4)="269296 were mailed from Austin to Accounts Receivable twice on"
S ^TMP($J,"RCRJRCORMM",5)="November 10, 2000 and November 13, 2000. Accounts Receivable"
S ^TMP($J,"RCRJRCORMM",6)="patch PRCA*4.5*164 has been installed and has backed out the"
S ^TMP($J,"RCRJRCORMM",7)="payments processed on November 13, 2000. This mailman message"
S ^TMP($J,"RCRJRCORMM",8)="shows those bills where payments were removed for the duplicate"
S ^TMP($J,"RCRJRCORMM",9)="deposit. You may want to review the bills and verify the"
S ^TMP($J,"RCRJRCORMM",10)="balances."
S ^TMP($J,"RCRJRCORMM",11)=" "
;
S ^TMP($J,"RCRJRCORMM",12)="BILL PAYMENT TRANS "_$J("PAYMENT",10)_$J("NEW BILL",10)
S ^TMP($J,"RCRJRCORMM",13)="NUMBER BILL TYPE TRANS# DATE "_$J("AMOUNT",10)_$J("AMOUNT",10)
S ^TMP($J,"RCRJRCORMM",14)="-----------------------------------------------------------------------------"
S LINE=14
;
S TOTAL=0
S RCBILLDA=0 F S RCBILLDA=$O(^TMP("PRCAI164",$J,RCBILLDA)) Q:'RCBILLDA D
. S COUNT=0
. S RCTRANDA=0 F S RCTRANDA=$O(^TMP("PRCAI164",$J,RCBILLDA,RCTRANDA)) Q:'RCTRANDA D
. . S RCTRAN1=$G(^PRCA(433,RCTRANDA,1))
. . S TYPE=$P($G(^PRCA(430.2,+$P($G(^PRCA(430,RCBILLDA,0)),"^",2),0)),"^")
. . ;
. . ; show bill (use count to for showing it different the second time)
. . S DATA=$E($P(^PRCA(430,RCBILLDA,0),"^")_" ",1,13)_$E(TYPE_" ",1,15)
. . I COUNT=1 S DATA=" "_" "
. . S COUNT=1
. . ;
. . ; show as increase or decrease
. . S %=" "
. . I TYPE["PREPAY" S %=$S($P(RCTRAN1,"^",2)=1:"INC",1:"DEC")_" "
. . S DATA=DATA_%
. . ;
. . ; show transaction number
. . S DATA=DATA_" "_$E(RCTRANDA_" ",1,12)
. . ;
. . ; show transaction date
. . S DATE=$P(RCTRAN1,"^",9) I DATE="" S DATE=" "
. . S DATA=DATA_$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)_" "
. . ;
. . ; show amount paid (show decrease as negative)
. . I $P(RCTRAN1,"^",2)=35 S $P(RCTRAN1,"^",5)=-$P(RCTRAN1,"^",5)
. . S DATA=DATA_$J($P(RCTRAN1,"^",5),10,2)
. . S TOTAL=TOTAL+$P(RCTRAN1,"^",5)
. . ;
. . ; show new bill balance
. . S %=$G(^PRCA(430,RCBILLDA,7)) S %=$P(%,"^")+$P(%,"^",2)+$P(%,"^",3)+$P(%,"^",4)+$P(%,"^",5)
. . S DATA=DATA_$J(%,10,2)
. . ;
. . ; store the line
. . S LINE=LINE+1,^TMP($J,"RCRJRCORMM",LINE)=DATA
. . ;
. . ; if there is a prepayment transaction on the bill, show that one also
. . S PPTRANS=$P($G(^PRCA(433,RCTRANDA,5)),"^")
. . I PPTRANS D
. . . S PPTRAN1=$G(^PRCA(433,PPTRANS,1))
. . . ; show bill paid by the prepayment
. . . S PPBILL=+$P($G(^PRCA(433,PPTRANS,0)),"^",2)
. . . S DATA=" "_$E("PREPAID "_$P($G(^PRCA(430,PPBILL,0)),"^")_" ",1,20)
. . . S DATA=DATA_" "_$E(PPTRANS_" ",1,12)
. . . ;
. . . ; show transaction date
. . . S DATE=$P(PPTRAN1,"^",9) I DATE="" S DATE=" "
. . . S DATA=DATA_$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)_" "
. . . ;
. . . ; show amount paid
. . . S DATA=DATA_$J($P(PPTRAN1,"^",5),10,2)
. . . S TOTAL=TOTAL+$P(PPTRAN1,"^",5)
. . . ;
. . . ; show new bill balance
. . . S %=$G(^PRCA(430,PPBILL,7)) S %=$P(%,"^")+$P(%,"^",2)+$P(%,"^",3)+$P(%,"^",4)+$P(%,"^",5)
. . . S DATA=DATA_$J(%,10,2)
. . . ;
. . . ; store the line
. . . S LINE=LINE+1,^TMP($J,"RCRJRCORMM",LINE)=DATA
;
I LINE=14 S ^TMP($J,"RCRJRCORMM",15)="<<No Bills Or Transactions Found For You to Review>>"
E S LINE=LINE+1,^TMP($J,"RCRJRCORMM",LINE)=" TOTAL PAID"_$J(TOTAL,10,2)
;
; send mail message
N DIFROM ; need to be newed or mailman will not deliver the message
S XMY("G.RCDP PAYMENTS")=""
S XMY(.5)=""
S XMY(DUZ)=""
S XMZ=$$SENDMSG^RCRJRCOR("AR Patch 164 Duplicate Deposit 269296",.XMY)
K ^TMP($J,"RCRJRCORMM")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCAI16M 4998 printed Dec 13, 2024@01:40:03 Page 2
PRCAI16M ;ALB/LDB-post init patch 164, generate mail message ;19 Nov 00
+1 ;;4.5;Accounts Receivable;**164**;Mar 20, 1995
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 QUIT
+4 ;
+5 ;
MAIL ; generate mail message to users
+1 ; rcmessag variable passed as to the status of the patch install.
+2 ; this variable appears on the first line of the message.
+3 DO MES^XPDUTL(" ...generating mailman message to G.RCDP PAYMENTS.")
+4 ;
+5 NEW %,COUNT,DATA,DATE,LINE,PPBILL,PPTRAN1,PPTRANS,RCBILLDA,RCTRAN1,RCTRANDA,TOTAL,TYPE,XMDUN,XMY,XMZ
+6 ;
+7 ; generate mailman message to user
+8 KILL ^TMP($JOB,"RCRJRCORMM")
+9 SET ^TMP($JOB,"RCRJRCORMM",1)=RCMESSAG
+10 SET ^TMP($JOB,"RCRJRCORMM",2)=" "
+11 SET ^TMP($JOB,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for deposit"
+12 SET ^TMP($JOB,"RCRJRCORMM",4)="269296 were mailed from Austin to Accounts Receivable twice on"
+13 SET ^TMP($JOB,"RCRJRCORMM",5)="November 10, 2000 and November 13, 2000. Accounts Receivable"
+14 SET ^TMP($JOB,"RCRJRCORMM",6)="patch PRCA*4.5*164 has been installed and has backed out the"
+15 SET ^TMP($JOB,"RCRJRCORMM",7)="payments processed on November 13, 2000. This mailman message"
+16 SET ^TMP($JOB,"RCRJRCORMM",8)="shows those bills where payments were removed for the duplicate"
+17 SET ^TMP($JOB,"RCRJRCORMM",9)="deposit. You may want to review the bills and verify the"
+18 SET ^TMP($JOB,"RCRJRCORMM",10)="balances."
+19 SET ^TMP($JOB,"RCRJRCORMM",11)=" "
+20 ;
+21 SET ^TMP($JOB,"RCRJRCORMM",12)="BILL PAYMENT TRANS "_$JUSTIFY("PAYMENT",10)_$JUSTIFY("NEW BILL",10)
+22 SET ^TMP($JOB,"RCRJRCORMM",13)="NUMBER BILL TYPE TRANS# DATE "_$JUSTIFY("AMOUNT",10)_$JUSTIFY("AMOUNT",10)
+23 SET ^TMP($JOB,"RCRJRCORMM",14)="-----------------------------------------------------------------------------"
+24 SET LINE=14
+25 ;
+26 SET TOTAL=0
+27 SET RCBILLDA=0
FOR
SET RCBILLDA=$ORDER(^TMP("PRCAI164",$JOB,RCBILLDA))
if 'RCBILLDA
QUIT
Begin DoDot:1
+28 SET COUNT=0
+29 SET RCTRANDA=0
FOR
SET RCTRANDA=$ORDER(^TMP("PRCAI164",$JOB,RCBILLDA,RCTRANDA))
if 'RCTRANDA
QUIT
Begin DoDot:2
+30 SET RCTRAN1=$GET(^PRCA(433,RCTRANDA,1))
+31 SET TYPE=$PIECE($GET(^PRCA(430.2,+$PIECE($GET(^PRCA(430,RCBILLDA,0)),"^",2),0)),"^")
+32 ;
+33 ; show bill (use count to for showing it different the second time)
+34 SET DATA=$EXTRACT($PIECE(^PRCA(430,RCBILLDA,0),"^")_" ",1,13)_$EXTRACT(TYPE_" ",1,15)
+35 IF COUNT=1
SET DATA=" "_" "
+36 SET COUNT=1
+37 ;
+38 ; show as increase or decrease
+39 SET %=" "
+40 IF TYPE["PREPAY"
SET %=$SELECT($PIECE(RCTRAN1,"^",2)=1:"INC",1:"DEC")_" "
+41 SET DATA=DATA_%
+42 ;
+43 ; show transaction number
+44 SET DATA=DATA_" "_$EXTRACT(RCTRANDA_" ",1,12)
+45 ;
+46 ; show transaction date
+47 SET DATE=$PIECE(RCTRAN1,"^",9)
IF DATE=""
SET DATE=" "
+48 SET DATA=DATA_$EXTRACT(DATE,4,5)_"/"_$EXTRACT(DATE,6,7)_"/"_$EXTRACT(DATE,2,3)_" "
+49 ;
+50 ; show amount paid (show decrease as negative)
+51 IF $PIECE(RCTRAN1,"^",2)=35
SET $PIECE(RCTRAN1,"^",5)=-$PIECE(RCTRAN1,"^",5)
+52 SET DATA=DATA_$JUSTIFY($PIECE(RCTRAN1,"^",5),10,2)
+53 SET TOTAL=TOTAL+$PIECE(RCTRAN1,"^",5)
+54 ;
+55 ; show new bill balance
+56 SET %=$GET(^PRCA(430,RCBILLDA,7))
SET %=$PIECE(%,"^")+$PIECE(%,"^",2)+$PIECE(%,"^",3)+$PIECE(%,"^",4)+$PIECE(%,"^",5)
+57 SET DATA=DATA_$JUSTIFY(%,10,2)
+58 ;
+59 ; store the line
+60 SET LINE=LINE+1
SET ^TMP($JOB,"RCRJRCORMM",LINE)=DATA
+61 ;
+62 ; if there is a prepayment transaction on the bill, show that one also
+63 SET PPTRANS=$PIECE($GET(^PRCA(433,RCTRANDA,5)),"^")
+64 IF PPTRANS
Begin DoDot:3
+65 SET PPTRAN1=$GET(^PRCA(433,PPTRANS,1))
+66 ; show bill paid by the prepayment
+67 SET PPBILL=+$PIECE($GET(^PRCA(433,PPTRANS,0)),"^",2)
+68 SET DATA=" "_$EXTRACT("PREPAID "_$PIECE($GET(^PRCA(430,PPBILL,0)),"^")_" ",1,20)
+69 SET DATA=DATA_" "_$EXTRACT(PPTRANS_" ",1,12)
+70 ;
+71 ; show transaction date
+72 SET DATE=$PIECE(PPTRAN1,"^",9)
IF DATE=""
SET DATE=" "
+73 SET DATA=DATA_$EXTRACT(DATE,4,5)_"/"_$EXTRACT(DATE,6,7)_"/"_$EXTRACT(DATE,2,3)_" "
+74 ;
+75 ; show amount paid
+76 SET DATA=DATA_$JUSTIFY($PIECE(PPTRAN1,"^",5),10,2)
+77 SET TOTAL=TOTAL+$PIECE(PPTRAN1,"^",5)
+78 ;
+79 ; show new bill balance
+80 SET %=$GET(^PRCA(430,PPBILL,7))
SET %=$PIECE(%,"^")+$PIECE(%,"^",2)+$PIECE(%,"^",3)+$PIECE(%,"^",4)+$PIECE(%,"^",5)
+81 SET DATA=DATA_$JUSTIFY(%,10,2)
+82 ;
+83 ; store the line
+84 SET LINE=LINE+1
SET ^TMP($JOB,"RCRJRCORMM",LINE)=DATA
End DoDot:3
End DoDot:2
End DoDot:1
+85 ;
+86 IF LINE=14
SET ^TMP($JOB,"RCRJRCORMM",15)="<<No Bills Or Transactions Found For You to Review>>"
+87 IF '$TEST
SET LINE=LINE+1
SET ^TMP($JOB,"RCRJRCORMM",LINE)=" TOTAL PAID"_$JUSTIFY(TOTAL,10,2)
+88 ;
+89 ; send mail message
+90 ; need to be newed or mailman will not deliver the message
NEW DIFROM
+91 SET XMY("G.RCDP PAYMENTS")=""
+92 SET XMY(.5)=""
+93 SET XMY(DUZ)=""
+94 SET XMZ=$$SENDMSG^RCRJRCOR("AR Patch 164 Duplicate Deposit 269296",.XMY)
+95 KILL ^TMP($JOB,"RCRJRCORMM")
+96 QUIT