X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fpayment.cgi;h=aec68af455c12f97daa0ee278a155812a9fd6223;hp=ada925c55b10ec4cc0f679227b8dc35aa5fb8ec1;hb=0f7643c1af2d909e0c3172e5bec0c01855fca1b9;hpb=357b4e26965895666685590d59f72de331fecb08 diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index ada925c55..aec68af45 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -67,6 +67,11 @@ % } +<% include('/elements/tr-select-discount_term.html', + 'custnum' => $custnum, + 'cgi' => $cgi + ) +%> % if ( $payby eq 'CARD' ) { % @@ -300,9 +305,14 @@ my $fee = ''; my $fee_pkg = ''; my $fee_display = ''; my $fee_op = ''; -if ( $conf->config('manual_process-pkgpart') ) { - - last if $conf->exists('manual_process-skip_first') && ! $cust_main->cust_pay; +my $num_payments = scalar($cust_main->cust_pay); +#handle old cust_main.pm (remove...) +$num_payments = scalar( @{ [ $cust_main->cust_pay ] } ) + unless defined $num_payments; +if ( $conf->config('manual_process-pkgpart') + and ! $conf->exists('manual_process-skip_first') || $num_payments + ) +{ $fee_display = $conf->config('manual_process-display') || 'add'; $fee_op = $fee_display eq 'add' ? '+' : '-'; @@ -322,6 +332,10 @@ if ( $balance > 0 ) { $amount = $balance; $amount += $fee if $fee && $fee_display eq 'subtract'; + + my $cc_surcharge_pct = $conf->config('credit-card-surcharge-percentage'); + $amount += $amount * $cc_surcharge_pct/100 if $cc_surcharge_pct > 0; + $amount = sprintf("%.2f", $amount); }