X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fpayment.cgi;h=90b03c7e87b465b40e7daaa2490eb763eade2eba;hb=028c83edfa000f6bdbcd32ee3ffd5ee5561110d2;hp=7546a858ad1ec6d4b5d031fcdc0e4b3531b2bf3e;hpb=19f9cc14302fdae5dbfcb580abea3c03ee612593;p=freeside.git diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 7546a858a..90b03c7e8 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -1,212 +1,239 @@ -<% 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" @@ -227,20 +254,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> - -