Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: RCDPXFIM

RCDPXFIM.m

Go to the documentation of this file.
  1. 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
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. MAIL(RCDPOSIT,RCTRANDT,RCMESSAG) ; generate mail message to users
  1. ; RCDPOSIT is the deposit number, example 269296
  1. ; RCTRANDT is the transmission date, example 3001113
  1. ; RCMESSAG is the status of backing out the deposit. this variable
  1. ; appears on the first line of the message.
  1. ;
  1. N %,COUNT,DATA,DATE,LINE,PPBILL,PPTRAN1,PPTRANS,RCBILLDA,RCTRAN1,RCTRANDA,TOTAL,TYPE,XMDUN,XMY,XMZ
  1. ;
  1. ; generate mailman message to user
  1. K ^TMP($J,"RCRJRCORMM")
  1. S ^TMP($J,"RCRJRCORMM",1)=RCMESSAG
  1. S ^TMP($J,"RCRJRCORMM",2)=" "
  1. ;
  1. ;**306 replacing this text with more generic text
  1. ;S ^TMP($J,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for deposit"
  1. ;S ^TMP($J,"RCRJRCORMM",4)=RCDPOSIT_" were mailed from Austin to Accounts Receivable twice."
  1. ;S ^TMP($J,"RCRJRCORMM",5)="AR has removed the duplicate deposit with a transmission date of"
  1. ;S ^TMP($J,"RCRJRCORMM",6)=$E(RCTRANDT,4,5)_"/"_$E(RCTRANDT,6,7)_"/"_$E(RCTRANDT,2,3)_"."
  1. ;S ^TMP($J,"RCRJRCORMM",7)=" "
  1. ;S ^TMP($J,"RCRJRCORMM",8)="This mailman message shows those bills where payments were"
  1. ;S ^TMP($J,"RCRJRCORMM",9)="removed for the duplicate deposit. The payment transactions"
  1. ;S ^TMP($J,"RCRJRCORMM",10)="listed below have been marked incomplete. You may want to"
  1. ;S ^TMP($J,"RCRJRCORMM",11)="review the bills and verify the balances."
  1. ;
  1. ; **306 new text
  1. S ^TMP($J,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for"
  1. S ^TMP($J,"RCRJRCORMM",4)="deposit "_RCDPOSIT_" were sent from Austin to Accounts"
  1. S ^TMP($J,"RCRJRCORMM",5)="Receivable. AR has removed the deposit."
  1. S ^TMP($J,"RCRJRCORMM",6)=""
  1. S ^TMP($J,"RCRJRCORMM",7)="This mailman message shows those bills where payments were"
  1. S ^TMP($J,"RCRJRCORMM",8)="removed from the deposit. The payment transactions listed"
  1. S ^TMP($J,"RCRJRCORMM",9)="below have been marked incomplete. You may want to review"
  1. S ^TMP($J,"RCRJRCORMM",10)="the bills and verify the balances."
  1. S ^TMP($J,"RCRJRCORMM",11)=" "
  1. S ^TMP($J,"RCRJRCORMM",12)=" "
  1. ;
  1. S ^TMP($J,"RCRJRCORMM",13)="BILL PAYMENT TRANS "_$J("PAYMENT",10)_$J("NEW BILL",10)
  1. S ^TMP($J,"RCRJRCORMM",14)="NUMBER BILL TYPE TRANS# DATE "_$J("AMOUNT",10)_$J("AMOUNT",10)
  1. S ^TMP($J,"RCRJRCORMM",15)="-----------------------------------------------------------------------------"
  1. S LINE=15
  1. ;
  1. S TOTAL=0
  1. S RCBILLDA=0 F S RCBILLDA=$O(^TMP("RCDPXFIX",$J,RCBILLDA)) Q:'RCBILLDA D
  1. . S COUNT=0
  1. . S RCTRANDA=0 F S RCTRANDA=$O(^TMP("RCDPXFIX",$J,RCBILLDA,RCTRANDA)) Q:'RCTRANDA D
  1. . . S RCTRAN1=$G(^PRCA(433,RCTRANDA,1))
  1. . . S TYPE=$P($G(^PRCA(430.2,+$P($G(^PRCA(430,RCBILLDA,0)),"^",2),0)),"^")
  1. . . ;
  1. . . ; show bill (use count to for showing it different the second time)
  1. . . S DATA=$E($P(^PRCA(430,RCBILLDA,0),"^")_" ",1,13)_$E(TYPE_" ",1,15)
  1. . . I COUNT=1 S DATA=" "_" "
  1. . . S COUNT=1
  1. . . ;
  1. . . ; show as increase or decrease
  1. . . S %=" "
  1. . . I TYPE["PREPAY" S %=$S($P(RCTRAN1,"^",2)=1:"INC",1:"DEC")_" "
  1. . . S DATA=DATA_%
  1. . . ;
  1. . . ; show transaction number
  1. . . S DATA=DATA_" "_$E(RCTRANDA_" ",1,12)
  1. . . ;
  1. . . ; show transaction date
  1. . . S DATE=$P(RCTRAN1,"^",9) I DATE="" S DATE=" "
  1. . . S DATA=DATA_$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)_" "
  1. . . ;
  1. . . ; show amount paid (show decrease as negative)
  1. . . I $P(RCTRAN1,"^",2)=35 S $P(RCTRAN1,"^",5)=-$P(RCTRAN1,"^",5)
  1. . . S DATA=DATA_$J($P(RCTRAN1,"^",5),10,2)
  1. . . S TOTAL=TOTAL+$P(RCTRAN1,"^",5)
  1. . . ;
  1. . . ; show new bill balance
  1. . . S %=$G(^PRCA(430,RCBILLDA,7)) S %=$P(%,"^")+$P(%,"^",2)+$P(%,"^",3)+$P(%,"^",4)+$P(%,"^",5)
  1. . . S DATA=DATA_$J(%,10,2)
  1. . . ;
  1. . . ; store the line
  1. . . S LINE=LINE+1,^TMP($J,"RCRJRCORMM",LINE)=DATA
  1. . . ;
  1. . . ; if there is a prepayment transaction on the bill, show that one also
  1. . . S PPTRANS=$P($G(^PRCA(433,RCTRANDA,5)),"^")
  1. . . I PPTRANS D
  1. . . . S PPTRAN1=$G(^PRCA(433,PPTRANS,1))
  1. . . . ; show bill paid by the prepayment
  1. . . . S PPBILL=+$P($G(^PRCA(433,PPTRANS,0)),"^",2)
  1. . . . S DATA=" "_$E("PREPAID "_$P($G(^PRCA(430,PPBILL,0)),"^")_" ",1,20)
  1. . . . S DATA=DATA_" "_$E(PPTRANS_" ",1,12)
  1. . . . ;
  1. . . . ; show transaction date
  1. . . . S DATE=$P(PPTRAN1,"^",9) I DATE="" S DATE=" "
  1. . . . S DATA=DATA_$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)_" "
  1. . . . ;
  1. . . . ; show amount paid
  1. . . . S DATA=DATA_$J($P(PPTRAN1,"^",5),10,2)
  1. . . . S TOTAL=TOTAL+$P(PPTRAN1,"^",5)
  1. . . . ;
  1. . . . ; show new bill balance
  1. . . . S %=$G(^PRCA(430,PPBILL,7)) S %=$P(%,"^")+$P(%,"^",2)+$P(%,"^",3)+$P(%,"^",4)+$P(%,"^",5)
  1. . . . S DATA=DATA_$J(%,10,2)
  1. . . . ;
  1. . . . ; store the line
  1. . . . S LINE=LINE+1,^TMP($J,"RCRJRCORMM",LINE)=DATA
  1. ;
  1. I LINE=15 S ^TMP($J,"RCRJRCORMM",16)="<<No Bills Or Transactions Found For You to Review>>"
  1. E S LINE=LINE+1,^TMP($J,"RCRJRCORMM",LINE)=" TOTAL PAID"_$J(TOTAL,10,2)
  1. ;
  1. ; send mail message
  1. N DIFROM ; need to be newed or mailman will not deliver the message
  1. S XMY("G.RCDP PAYMENTS")=""
  1. S XMY(.5)=""
  1. S XMY(DUZ)=""
  1. ; **306 removing "duplicate" to make more generic
  1. ;S XMZ=$$SENDMSG^RCRJRCOR("AR Duplicate Deposit "_RCDPOSIT_" removed",.XMY)
  1. S XMZ=$$SENDMSG^RCRJRCOR("AR Deposit "_RCDPOSIT_" removed",.XMY)
  1. K ^TMP($J,"RCRJRCORMM")
  1. Q