X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fmisc%2Fpayment.cgi;h=35f57e8d6dd9498d4b38fd93d9f05de586b9b069;hb=eb1ff5885cd1abf6c94cfcb0f46de7c651f50ac9;hp=447cfa3c1311f31188c5f0088e14c523e77b833c;hpb=4e764e5f9a7b690baf95906c4455311c2560120f;p=freeside.git
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index 447cfa3c1..35f57e8d6 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -1,5 +1,7 @@
-<& /elements/header.html, mt("Process [_1] payment",$type{$payby}) &>
-<& /elements/small_custview.html, $cust_main, '', '', popurl(2) . "view/cust_main.cgi" &>
+<& /elements/header-cust_main.html, view=>'payment_history', cust_main=>$cust_main &>
+
+
<% emt("Process [_1] payment",$type{$payby}) %>
+
-<& /elements/footer.html &>
+<& /elements/footer-cust_main.html &>
+<%once>
+
+my %weight = (
+ 1 => 'Primary',
+ 2 => 'Secondary',
+ 3 => 'Tertiary',
+ 4 => 'Fourth',
+ 5 => 'Fifth',
+ 6 => 'Sixth',
+ 7 => 'Seventh',
+);
+
+%once>
<%init>
die "access denied"
@@ -290,8 +349,6 @@ my $payinfo = '';
my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
-
#false laziness w/selfservice make_payment.html shortcut for one-country
my %states = map { $_->state => 1 }
qsearch('cust_main_county', {
@@ -299,42 +356,13 @@ my %states = map { $_->state => 1 }
} );
my @states = sort { $a cmp $b } keys %states;
-my $fee = '';
-my $fee_pkg = '';
-my $fee_display = '';
-my $fee_op = '';
-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' ? '+' : '-';
-
- $fee_pkg =
- qsearchs('part_pkg', { pkgpart=>$conf->config('manual_process-pkgpart') } );
-
- #well ->unit_setup or ->calc_setup both call for a $cust_pkg
- # (though ->unit_setup doesn't use it...)
- $fee = $fee_pkg->option('setup_fee')
- if $fee_pkg; #in case.. better than dying with a perl traceback
-
-}
-
my $amount = '';
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);
+ # 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;