X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_pay.cgi;h=07e51989e75d8ce74946337a401ee08b01c4786f;hb=d0221fabd4656b3a04251ca6168cc45f54d23574;hp=855fbfcf125f4492a9030d2545e0d677ac86cd5e;hpb=b19266599870172bda0921df60020f0440854750;p=freeside.git diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 855fbfcf1..07e51989e 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -4,27 +4,22 @@ <% include("/elements/header.html", $title, '') %> % } -% if ( $cgi->param('error') ) { - Error: <% $cgi->param('error') %> -

-% } - - - - - +<% include('/elements/init_calendar.html') %> -
- - +<% include('/elements/error.html') %> % unless ( $link eq 'popup' ) { <% small_custview($custnum, $conf->config('countrydefault')) %> % } + + + +

+ Payment <% ntable("#cccccc", 2) %> @@ -48,7 +43,7 @@ Payment Amount <% $money_char %> - by <% $payby{$payby} %> + by <% FS::payby->payname($payby) %> % if ( $payby eq 'BILL' ) { @@ -77,32 +72,40 @@ Payment % } - +% if ( $conf->exists('pkg-balances') ) { + <% include('/elements/tr-select-cust_pkg-balances.html', + 'custnum' => $custnum, + 'cgi' => $cgi + ) + %> +% } else { + +% } - +
- - -<%once> -my $conf = new FS::Conf; +% if ( $link eq 'popup' ) { + + +% } else { + <% include('/elements/footer.html') %> +% } -my %payby = ( - 'BILL' => 'Check', - 'CASH' => 'Cash', - 'WEST' => 'Western Union', - 'MCRD' => 'Manual credit card', -); +<%init> + +my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; - -<%init> -my($link, $linknum, $paid, $payby, $payinfo, $_date); +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Post payment'); + +my($link, $linknum, $paid, $payby, $payinfo, $_date); if ( $cgi->param('error') ) { $link = $cgi->param('link'); $linknum = $cgi->param('linknum'); @@ -130,7 +133,7 @@ if ( $cgi->param('error') ) { my $paybatch = "webui-$_date-$$-". rand() * 2**32; -my $title = 'Post '. $payby{$payby}. ' payment'; +my $title = 'Post '. FS::payby->payname($payby). ' payment'; $title .= " against Invoice #$linknum" if $link eq 'invnum'; my $custnum; @@ -138,8 +141,8 @@ if ( $link eq 'invnum' ) { my $cust_bill = qsearchs('cust_bill', { 'invnum' => $linknum } ) or die "unknown invnum $linknum"; $custnum = $cust_bill->custnum; -} elsif ( $link eq 'custnum' ) { +} elsif ( $link eq 'custnum' || $link eq 'popup' ) { $custnum = $linknum; } - +