RCDPXFIM ;WISC/RFJ-generate mail message for removing duplicate deposit ;22 Mar 02
;;4.5;Accounts Receivable;**177,306**;Mar 20, 1995;Build 3
;;Per VA Directive 6402, this routine should not be modified.
Q
;
;
MAIL(RCDPOSIT,RCTRANDT,RCMESSAG) ; generate mail message to users
; RCDPOSIT is the deposit number, example 269296
; RCTRANDT is the transmission date, example 3001113
; RCMESSAG is the status of backing out the deposit. this variable
; appears on the first line of the message.
;
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)=" "
;
;**306 replacing this text with more generic text
;S ^TMP($J,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for deposit"
;S ^TMP($J,"RCRJRCORMM",4)=RCDPOSIT_" were mailed from Austin to Accounts Receivable twice."
;S ^TMP($J,"RCRJRCORMM",5)="AR has removed the duplicate deposit with a transmission date of"
;S ^TMP($J,"RCRJRCORMM",6)=$E(RCTRANDT,4,5)_"/"_$E(RCTRANDT,6,7)_"/"_$E(RCTRANDT,2,3)_"."
;S ^TMP($J,"RCRJRCORMM",7)=" "
;S ^TMP($J,"RCRJRCORMM",8)="This mailman message shows those bills where payments were"
;S ^TMP($J,"RCRJRCORMM",9)="removed for the duplicate deposit. The payment transactions"
;S ^TMP($J,"RCRJRCORMM",10)="listed below have been marked incomplete. You may want to"
;S ^TMP($J,"RCRJRCORMM",11)="review the bills and verify the balances."
;
; **306 new text
S ^TMP($J,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for"
S ^TMP($J,"RCRJRCORMM",4)="deposit "_RCDPOSIT_" were sent from Austin to Accounts"
S ^TMP($J,"RCRJRCORMM",5)="Receivable. AR has removed the deposit."
S ^TMP($J,"RCRJRCORMM",6)=""
S ^TMP($J,"RCRJRCORMM",7)="This mailman message shows those bills where payments were"
S ^TMP($J,"RCRJRCORMM",8)="removed from the deposit. The payment transactions listed"
S ^TMP($J,"RCRJRCORMM",9)="below have been marked incomplete. You may want to review"
S ^TMP($J,"RCRJRCORMM",10)="the bills and verify the balances."
S ^TMP($J,"RCRJRCORMM",11)=" "
S ^TMP($J,"RCRJRCORMM",12)=" "
;
S ^TMP($J,"RCRJRCORMM",13)="BILL PAYMENT TRANS "_$J("PAYMENT",10)_$J("NEW BILL",10)
S ^TMP($J,"RCRJRCORMM",14)="NUMBER BILL TYPE TRANS# DATE "_$J("AMOUNT",10)_$J("AMOUNT",10)
S ^TMP($J,"RCRJRCORMM",15)="-----------------------------------------------------------------------------"
S LINE=15
;
S TOTAL=0
S RCBILLDA=0 F S RCBILLDA=$O(^TMP("RCDPXFIX",$J,RCBILLDA)) Q:'RCBILLDA D
. S COUNT=0
. S RCTRANDA=0 F S RCTRANDA=$O(^TMP("RCDPXFIX",$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=15 S ^TMP($J,"RCRJRCORMM",16)="<<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)=""
; **306 removing "duplicate" to make more generic
;S XMZ=$$SENDMSG^RCRJRCOR("AR Duplicate Deposit "_RCDPOSIT_" removed",.XMY)
S XMZ=$$SENDMSG^RCRJRCOR("AR Deposit "_RCDPOSIT_" removed",.XMY)
K ^TMP($J,"RCRJRCORMM")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCDPXFIM 5994 printed Dec 13, 2024@01:46:39 Page 2
RCDPXFIM ;WISC/RFJ-generate mail message for removing duplicate deposit ;22 Mar 02
+1 ;;4.5;Accounts Receivable;**177,306**;Mar 20, 1995;Build 3
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 QUIT
+4 ;
+5 ;
MAIL(RCDPOSIT,RCTRANDT,RCMESSAG) ; generate mail message to users
+1 ; RCDPOSIT is the deposit number, example 269296
+2 ; RCTRANDT is the transmission date, example 3001113
+3 ; RCMESSAG is the status of backing out the deposit. this variable
+4 ; appears on the first line of the message.
+5 ;
+6 NEW %,COUNT,DATA,DATE,LINE,PPBILL,PPTRAN1,PPTRANS,RCBILLDA,RCTRAN1,RCTRANDA,TOTAL,TYPE,XMDUN,XMY,XMZ
+7 ;
+8 ; generate mailman message to user
+9 KILL ^TMP($JOB,"RCRJRCORMM")
+10 SET ^TMP($JOB,"RCRJRCORMM",1)=RCMESSAG
+11 SET ^TMP($JOB,"RCRJRCORMM",2)=" "
+12 ;
+13 ;**306 replacing this text with more generic text
+14 ;S ^TMP($J,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for deposit"
+15 ;S ^TMP($J,"RCRJRCORMM",4)=RCDPOSIT_" were mailed from Austin to Accounts Receivable twice."
+16 ;S ^TMP($J,"RCRJRCORMM",5)="AR has removed the duplicate deposit with a transmission date of"
+17 ;S ^TMP($J,"RCRJRCORMM",6)=$E(RCTRANDT,4,5)_"/"_$E(RCTRANDT,6,7)_"/"_$E(RCTRANDT,2,3)_"."
+18 ;S ^TMP($J,"RCRJRCORMM",7)=" "
+19 ;S ^TMP($J,"RCRJRCORMM",8)="This mailman message shows those bills where payments were"
+20 ;S ^TMP($J,"RCRJRCORMM",9)="removed for the duplicate deposit. The payment transactions"
+21 ;S ^TMP($J,"RCRJRCORMM",10)="listed below have been marked incomplete. You may want to"
+22 ;S ^TMP($J,"RCRJRCORMM",11)="review the bills and verify the balances."
+23 ;
+24 ; **306 new text
+25 SET ^TMP($JOB,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for"
+26 SET ^TMP($JOB,"RCRJRCORMM",4)="deposit "_RCDPOSIT_" were sent from Austin to Accounts"
+27 SET ^TMP($JOB,"RCRJRCORMM",5)="Receivable. AR has removed the deposit."
+28 SET ^TMP($JOB,"RCRJRCORMM",6)=""
+29 SET ^TMP($JOB,"RCRJRCORMM",7)="This mailman message shows those bills where payments were"
+30 SET ^TMP($JOB,"RCRJRCORMM",8)="removed from the deposit. The payment transactions listed"
+31 SET ^TMP($JOB,"RCRJRCORMM",9)="below have been marked incomplete. You may want to review"
+32 SET ^TMP($JOB,"RCRJRCORMM",10)="the bills and verify the balances."
+33 SET ^TMP($JOB,"RCRJRCORMM",11)=" "
+34 SET ^TMP($JOB,"RCRJRCORMM",12)=" "
+35 ;
+36 SET ^TMP($JOB,"RCRJRCORMM",13)="BILL PAYMENT TRANS "_$JUSTIFY("PAYMENT",10)_$JUSTIFY("NEW BILL",10)
+37 SET ^TMP($JOB,"RCRJRCORMM",14)="NUMBER BILL TYPE TRANS# DATE "_$JUSTIFY("AMOUNT",10)_$JUSTIFY("AMOUNT",10)
+38 SET ^TMP($JOB,"RCRJRCORMM",15)="-----------------------------------------------------------------------------"
+39 SET LINE=15
+40 ;
+41 SET TOTAL=0
+42 SET RCBILLDA=0
FOR
SET RCBILLDA=$ORDER(^TMP("RCDPXFIX",$JOB,RCBILLDA))
if 'RCBILLDA
QUIT
Begin DoDot:1
+43 SET COUNT=0
+44 SET RCTRANDA=0
FOR
SET RCTRANDA=$ORDER(^TMP("RCDPXFIX",$JOB,RCBILLDA,RCTRANDA))
if 'RCTRANDA
QUIT
Begin DoDot:2
+45 SET RCTRAN1=$GET(^PRCA(433,RCTRANDA,1))
+46 SET TYPE=$PIECE($GET(^PRCA(430.2,+$PIECE($GET(^PRCA(430,RCBILLDA,0)),"^",2),0)),"^")
+47 ;
+48 ; show bill (use count to for showing it different the second time)
+49 SET DATA=$EXTRACT($PIECE(^PRCA(430,RCBILLDA,0),"^")_" ",1,13)_$EXTRACT(TYPE_" ",1,15)
+50 IF COUNT=1
SET DATA=" "_" "
+51 SET COUNT=1
+52 ;
+53 ; show as increase or decrease
+54 SET %=" "
+55 IF TYPE["PREPAY"
SET %=$SELECT($PIECE(RCTRAN1,"^",2)=1:"INC",1:"DEC")_" "
+56 SET DATA=DATA_%
+57 ;
+58 ; show transaction number
+59 SET DATA=DATA_" "_$EXTRACT(RCTRANDA_" ",1,12)
+60 ;
+61 ; show transaction date
+62 SET DATE=$PIECE(RCTRAN1,"^",9)
IF DATE=""
SET DATE=" "
+63 SET DATA=DATA_$EXTRACT(DATE,4,5)_"/"_$EXTRACT(DATE,6,7)_"/"_$EXTRACT(DATE,2,3)_" "
+64 ;
+65 ; show amount paid (show decrease as negative)
+66 IF $PIECE(RCTRAN1,"^",2)=35
SET $PIECE(RCTRAN1,"^",5)=-$PIECE(RCTRAN1,"^",5)
+67 SET DATA=DATA_$JUSTIFY($PIECE(RCTRAN1,"^",5),10,2)
+68 SET TOTAL=TOTAL+$PIECE(RCTRAN1,"^",5)
+69 ;
+70 ; show new bill balance
+71 SET %=$GET(^PRCA(430,RCBILLDA,7))
SET %=$PIECE(%,"^")+$PIECE(%,"^",2)+$PIECE(%,"^",3)+$PIECE(%,"^",4)+$PIECE(%,"^",5)
+72 SET DATA=DATA_$JUSTIFY(%,10,2)
+73 ;
+74 ; store the line
+75 SET LINE=LINE+1
SET ^TMP($JOB,"RCRJRCORMM",LINE)=DATA
+76 ;
+77 ; if there is a prepayment transaction on the bill, show that one also
+78 SET PPTRANS=$PIECE($GET(^PRCA(433,RCTRANDA,5)),"^")
+79 IF PPTRANS
Begin DoDot:3
+80 SET PPTRAN1=$GET(^PRCA(433,PPTRANS,1))
+81 ; show bill paid by the prepayment
+82 SET PPBILL=+$PIECE($GET(^PRCA(433,PPTRANS,0)),"^",2)
+83 SET DATA=" "_$EXTRACT("PREPAID "_$PIECE($GET(^PRCA(430,PPBILL,0)),"^")_" ",1,20)
+84 SET DATA=DATA_" "_$EXTRACT(PPTRANS_" ",1,12)
+85 ;
+86 ; show transaction date
+87 SET DATE=$PIECE(PPTRAN1,"^",9)
IF DATE=""
SET DATE=" "
+88 SET DATA=DATA_$EXTRACT(DATE,4,5)_"/"_$EXTRACT(DATE,6,7)_"/"_$EXTRACT(DATE,2,3)_" "
+89 ;
+90 ; show amount paid
+91 SET DATA=DATA_$JUSTIFY($PIECE(PPTRAN1,"^",5),10,2)
+92 SET TOTAL=TOTAL+$PIECE(PPTRAN1,"^",5)
+93 ;
+94 ; show new bill balance
+95 SET %=$GET(^PRCA(430,PPBILL,7))
SET %=$PIECE(%,"^")+$PIECE(%,"^",2)+$PIECE(%,"^",3)+$PIECE(%,"^",4)+$PIECE(%,"^",5)
+96 SET DATA=DATA_$JUSTIFY(%,10,2)
+97 ;
+98 ; store the line
+99 SET LINE=LINE+1
SET ^TMP($JOB,"RCRJRCORMM",LINE)=DATA
End DoDot:3
End DoDot:2
End DoDot:1
+100 ;
+101 IF LINE=15
SET ^TMP($JOB,"RCRJRCORMM",16)="<<No Bills Or Transactions Found For You to Review>>"
+102 IF '$TEST
SET LINE=LINE+1
SET ^TMP($JOB,"RCRJRCORMM",LINE)=" TOTAL PAID"_$JUSTIFY(TOTAL,10,2)
+103 ;
+104 ; send mail message
+105 ; need to be newed or mailman will not deliver the message
NEW DIFROM
+106 SET XMY("G.RCDP PAYMENTS")=""
+107 SET XMY(.5)=""
+108 SET XMY(DUZ)=""
+109 ; **306 removing "duplicate" to make more generic
+110 ;S XMZ=$$SENDMSG^RCRJRCOR("AR Duplicate Deposit "_RCDPOSIT_" removed",.XMY)
+111 SET XMZ=$$SENDMSG^RCRJRCOR("AR Deposit "_RCDPOSIT_" removed",.XMY)
+112 KILL ^TMP($JOB,"RCRJRCORMM")
+113 QUIT