summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-06-25 10:55:00 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-06-25 13:00:41 -0400
commitc1cf74717bd47f5b89123eb1324c0e990c6dfe4d (patch)
treea5e6dca3ff5a35485f5fabfd3fd52e97be28ee8d
parentcfde6a0e4f1c3c129a1a2d8b6c4e38930c71f998 (diff)
RT# 82137 - added processing fee template substitution.
Conflicts: httemplate/edit/msg_template/email.html httemplate/elements/tr-amount_fee.html
-rw-r--r--httemplate/edit/msg_template.html2
-rw-r--r--httemplate/elements/tr-amount_fee.html6
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: '
<BR>Enclose substitutions and other Perl expressions in braces:
<BR>{ $name } = ExampleCo (Smith, John)
<BR>{ time2str("%D", time) } = '.time2str("%D", time).'
+<BR>{ "processing fee of $processing_fee" if $processing_fee; } = Will display text if there is a processing fee
</FONT></TD>
';
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);