source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCDPXFIM.m@ 836

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

initial load of WorldVistAEHR

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