X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-amount_fee.html;h=1cd59bbc34dc66d03d5e18c8304e747d9ca20310;hb=959a59186f30a33d167b12e67d3c9cc4ce58a0f5;hp=12488521ad458419fd7dbe0ab67dc634557dae29;hpb=45346fd655ba53b82c80b920da945cc0b87ece01;p=freeside.git diff --git a/httemplate/elements/tr-amount_fee.html b/httemplate/elements/tr-amount_fee.html index 12488521a..1cd59bbc3 100644 --- a/httemplate/elements/tr-amount_fee.html +++ b/httemplate/elements/tr-amount_fee.html @@ -8,7 +8,7 @@ VALUE = "<% $amount %>" SIZE = 8 STYLE = "text-align:right;" -% if ( $fee ) { +% if ( $fee || $processing_fee) { onChange = "amount_changed(this)" onKeyDown = "amount_changed(this)" onKeyUp = "amount_changed(this)" @@ -32,7 +32,23 @@ -% if ( $fee ) { +% if ( $processing_fee ) { + + <% mt('Processing fee') |h %> + + + + +
+ + + Apply a processing fee of <% $processing_fee %> . +
+ + +% } + +% if ($fee) { + +% } + <%init> my %opt = @_; @@ -66,6 +103,7 @@ my $fee = ''; my $fee_pkg = ''; my $fee_display = ''; my $fee_op = ''; +my $processing_fee = 0; if ( $opt{'process-pkgpart'} and ! $opt{'process-skip_first'} || $opt{'num_payments'} @@ -94,6 +132,11 @@ if ( $amount > 0 ) { $amount += $amount * $opt{'surcharge_percentage'}/100 if $opt{'surcharge_percentage'} > 0; + $amount += $opt{'surcharge_flatfee'} + if $opt{'surcharge_flatfee'} > 0; + + $processing_fee = $opt{'processing_fee'} if $opt{'processing_fee'} > 0; + $amount = sprintf("%.2f", $amount); }