summaryrefslogtreecommitdiff
path: root/FS/FS/msg_template.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-10-23 20:24:40 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-10-23 20:24:40 -0500
commitacfdb8bec93849e35ae5c4abc276d6ca8006f717 (patch)
tree2352be75383b347dd05892e661642384d84e31e6 /FS/FS/msg_template.pm
parentbeb4c90e57b8063677a556a1a0bf10395ca49d4e (diff)
RT#38432: OFM - Send refund receipt
Diffstat (limited to 'FS/FS/msg_template.pm')
-rw-r--r--FS/FS/msg_template.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm
index 1d357b1a3..01a656366 100644
--- a/FS/FS/msg_template.pm
+++ b/FS/FS/msg_template.pm
@@ -614,6 +614,18 @@ sub substitutions {
$cust_pay->paymask : $cust_pay->decrypt($cust_pay->payinfo)
} ],
],
+ # for refund receipts
+ 'cust_refund' => [
+ 'refundnum',
+ [ refund => sub { sprintf("%.2f", shift->refund) } ],
+ [ payby => sub { FS::payby->shortname(shift->payby) } ],
+ [ date => sub { time2str("%a %B %o, %Y", shift->_date) } ],
+ [ payinfo => sub {
+ my $cust_refund = shift;
+ ($cust_refund->payby eq 'CARD' || $cust_refund->payby eq 'CHEK') ?
+ $cust_refund->paymask : $cust_refund->decrypt($cust_refund->payinfo)
+ } ],
+ ],
# for payment decline messages
# try to support all cust_pay fields
# 'error' is a special case, it contains the raw error from the gateway