RT# 79737 - fixed error in code
[freeside.git] / httemplate / misc / payment.cgi
index 24248eb..4f6f7ef 100644 (file)
@@ -1,6 +1,6 @@
-<& /elements/header.html, mt("Process [_1] payment",$type{$payby})  &>
-<& /elements/small_custview.html, $cust_main, '', '', popurl(2) . "view/cust_main.cgi" &>
-<BR>
+<& /elements/header-cust_main.html, view=>'payment_history', cust_main=>$cust_main &>
+
+<h2><% emt("Process [_1] payment",$type{$payby}) %></h2>
 
 <FORM NAME="OneTrueForm" ACTION="process/payment.cgi" METHOD="POST" onSubmit="document.OneTrueForm.process.disabled=true">
 <INPUT TYPE="hidden" NAME="custnum"   VALUE="<% $custnum %>">
@@ -12,8 +12,9 @@
 
 <TABLE class="fsinnerbox">
 
-  <& /elements/tr-amount_fee.html,
-       'amount'             => $amount,
+  <& /elements/tr-select-payment_options.html,
+       'custnum'            => $cust_main->custnum,
+       'amount'             => $balance,
        'process-pkgpart'    => 
           scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)),
        'process-display'    => scalar($conf->config('manual_process-display')),
              ? scalar($conf->config('credit-card-surcharge-percentage', $cust_main->agentnum))
              : 0
          ),
+       'surcharge_flatfee' =>
+         ( $payby eq 'CARD'
+             ? scalar($conf->config('credit-card-surcharge-flatfee', $cust_main->agentnum))
+             : 0
+         ),
   &>
 
 % if ( $conf->exists('part_pkg-term_discounts') ) {
@@ -309,7 +315,7 @@ function change_batch_checkbox () {
 <INPUT TYPE="submit" NAME="process" VALUE="<% mt('Process payment') |h %>">
 </FORM>
 
-<& /elements/footer.html &>
+<& /elements/footer-cust_main.html &>
 <%once>
 
 my %weight = (
@@ -356,15 +362,6 @@ my %states = map { $_->state => 1 }
                } );
 my @states = sort { $a cmp $b } keys %states;
 
-my $amount = '';
-if ( $balance > 0 ) {
-  # when configured to do so, amount will only auto-fill with balance
-  # if balance represents a single invoice
-  $amount = $balance
-    unless $conf->exists('manual_process-single_invoice_amount')
-      && ($cust_main->open_cust_bill != 1);
-}
-
 my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32;
 
 </%init>