X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fpayment.cgi;h=5b9f63dc0950f3ac2e24aa8d41194c2aa324fa05;hb=35e5b12fb55f229edd16bed66e21c5806b8d3b7e;hp=f99f2f068b979eaea3ba2ae5fbb38dcc9df2c6c6;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index f99f2f068..5b9f63dc0 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -1,220 +1,237 @@ -<% include( '/elements/header.html', "Process $type{$payby} payment" ) %> -<% include( '/elements/small_custview.html', $cust_main, '', '', popurl(2) . "view/cust_main.cgi" ) %> +<& /elements/header.html, mt("Process [_1] payment",$type{$payby}) &> +<& /elements/small_custview.html, $cust_main, '', '', popurl(2) . "view/cust_main.cgi" &>
-<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> die "access denied" @@ -235,20 +252,28 @@ my $custnum = $1; my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } ); die "unknown custnum $custnum" unless $cust_main; +my $location = $cust_main->bill_location; +# no proper error handling on this anyway, but when we have it, +# remember to repopulate fields in $location + my $balance = $cust_main->balance; my $payinfo = ''; -#false laziness w/selfservice make_payment.html shortcut for one-country my $conf = new FS::Conf; + +#false laziness w/selfservice make_payment.html shortcut for one-country my %states = map { $_->state => 1 } qsearch('cust_main_county', { 'country' => $conf->config('countrydefault') || 'US' } ); my @states = sort { $a cmp $b } keys %states; +my $amount = ''; +if ( $balance > 0 ) { + $amount = $balance; +} + my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32; %init> - -