source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/PRCAI16M.m@ 1259

Last change on this file since 1259 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

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