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

PRCAI16M.m

Go to the documentation of this file.
  1. PRCAI16M ;ALB/LDB-post init patch 164, generate mail message ;19 Nov 00
  1. ;;4.5;Accounts Receivable;**164**;Mar 20, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. MAIL ; generate mail message to users
  1. ; rcmessag variable passed as to the status of the patch install.
  1. ; this variable appears on the first line of the message.
  1. D MES^XPDUTL(" ...generating mailman message to G.RCDP PAYMENTS.")
  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. S ^TMP($J,"RCRJRCORMM",3)="The following bills need to be reviewed. Payments for deposit"
  1. S ^TMP($J,"RCRJRCORMM",4)="269296 were mailed from Austin to Accounts Receivable twice on"
  1. S ^TMP($J,"RCRJRCORMM",5)="November 10, 2000 and November 13, 2000. Accounts Receivable"
  1. S ^TMP($J,"RCRJRCORMM",6)="patch PRCA*4.5*164 has been installed and has backed out the"
  1. S ^TMP($J,"RCRJRCORMM",7)="payments processed on November 13, 2000. This mailman message"
  1. S ^TMP($J,"RCRJRCORMM",8)="shows those bills where payments were removed for the duplicate"
  1. S ^TMP($J,"RCRJRCORMM",9)="deposit. You may want to review the bills and verify the"
  1. S ^TMP($J,"RCRJRCORMM",10)="balances."
  1. S ^TMP($J,"RCRJRCORMM",11)=" "
  1. ;
  1. S ^TMP($J,"RCRJRCORMM",12)="BILL PAYMENT TRANS "_$J("PAYMENT",10)_$J("NEW BILL",10)
  1. S ^TMP($J,"RCRJRCORMM",13)="NUMBER BILL TYPE TRANS# DATE "_$J("AMOUNT",10)_$J("AMOUNT",10)
  1. S ^TMP($J,"RCRJRCORMM",14)="-----------------------------------------------------------------------------"
  1. S LINE=14
  1. ;
  1. S TOTAL=0
  1. S RCBILLDA=0 F S RCBILLDA=$O(^TMP("PRCAI164",$J,RCBILLDA)) Q:'RCBILLDA D
  1. . S COUNT=0
  1. . S RCTRANDA=0 F S RCTRANDA=$O(^TMP("PRCAI164",$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=14 S ^TMP($J,"RCRJRCORMM",15)="<<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. S XMZ=$$SENDMSG^RCRJRCOR("AR Patch 164 Duplicate Deposit 269296",.XMY)
  1. K ^TMP($J,"RCRJRCORMM")
  1. Q