From c1cf74717bd47f5b89123eb1324c0e990c6dfe4d Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Tue, 25 Jun 2019 10:55:00 -0400 Subject: [PATCH] RT# 82137 - added processing fee template substitution. Conflicts: httemplate/edit/msg_template/email.html httemplate/elements/tr-amount_fee.html --- httemplate/edit/msg_template.html | 2 ++ httemplate/elements/tr-amount_fee.html | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html index 17e9966de..1fa94ab2b 100644 --- a/httemplate/edit/msg_template.html +++ b/httemplate/edit/msg_template.html @@ -291,6 +291,7 @@ my %substitutions = ( 'cust_pay' => [ '$paynum' => 'Payment#', '$paid' => 'Amount', + '$processing_fee' => 'Processing fee', '$payby' => 'Payment method', '$date' => 'Payment date', '$payinfo' => 'Card/account# (masked)', @@ -365,6 +366,7 @@ Substitutions: '
Enclose substitutions and other Perl expressions in braces:
{ $name } = ExampleCo (Smith, John)
{ time2str("%D", time) } = '.time2str("%D", time).' +
{ "processing fee of $processing_fee" if $processing_fee; } = Will display text if there is a processing fee '; diff --git a/httemplate/elements/tr-amount_fee.html b/httemplate/elements/tr-amount_fee.html index 7797f6c2b..e90d36459 100644 --- a/httemplate/elements/tr-amount_fee.html +++ b/httemplate/elements/tr-amount_fee.html @@ -123,7 +123,9 @@ if ( $opt{'process-pkgpart'} } -my $amount = $opt{'amount'}; +$processing_fee = $opt{'processing_fee'} if $opt{'processing_fee'} > 0; + +my $amount = $opt{'amount'} ? $opt{'amount'} : "0.00"; if ( $amount > 0 ) { $amount += $fee if $fee && $fee_display eq 'subtract'; @@ -135,8 +137,6 @@ if ( $amount > 0 ) { $amount += $opt{'surcharge_flatfee'} if $opt{'surcharge_flatfee'} > 0; - $processing_fee = $opt{'processing_fee'} if $opt{'processing_fee'} > 0; - $amount += $processing_fee; ## needed if processing fee is checked on default. $amount = sprintf("%.2f", $amount); -- 2.11.0