X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_pay.cgi;h=0bb86e352e4bab0622273a68536f83ba70897fd4;hb=d0c5ddbd31af8b1747d447f31623e1af05961eb4;hp=855fbfcf125f4492a9030d2545e0d677ac86cd5e;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;p=freeside.git diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 855fbfcf1..0bb86e352 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -1,59 +1,59 @@ % if ( $link eq 'popup' ) { - <% include('/elements/header-popup.html', $title ) %> + <& /elements/header-popup.html, $title &> % } else { - <% include("/elements/header.html", $title, '') %> + <& /elements/header.html, $title, '' &> % } -% if ( $cgi->param('error') ) { - Error: <% $cgi->param('error') %> -

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

-Payment + +<% mt('Payment') |h %> <% ntable("#cccccc", 2) %> - Date + <% mt('Date') |h %> - "> - + + - Amount + <% mt('Amount') |h %> <% $money_char %> - by <% $payby{$payby} %> + <% mt('by') |h %> <% mt(FS::payby->payname($payby)) |h %> + <& /elements/tr-select-discount_term.html, + 'custnum' => $custnum, + 'cgi' => $cgi + &> + % if ( $payby eq 'BILL' ) { - Check # + <% mt('Check #') |h %> % } @@ -61,55 +61,60 @@ Payment % if ( $link eq 'custnum' || $link eq 'popup' ) { - Auto-apply
to invoices + <% mt('Auto-apply to invoices') |h %> +
- - -<%once> -my $conf = new FS::Conf; +% if ( $link eq 'popup' ) { + + +% } else { + <& /elements/footer.html &> +% } + +<%init> -my %payby = ( - 'BILL' => 'Check', - 'CASH' => 'Cash', - 'WEST' => 'Western Union', - 'MCRD' => 'Manual credit card', -); +my $conf = new FS::Conf; -my $money_char = $conf->config('money_char') || '$'; - +my $money_char = $conf->config('money_char') || '$'; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; -<%init> -my($link, $linknum, $paid, $payby, $payinfo, $_date); +my($link, $linknum, $paid, $payby, $payinfo, $_date); if ( $cgi->param('error') ) { $link = $cgi->param('link'); $linknum = $cgi->param('linknum'); $paid = $cgi->param('paid'); $payby = $cgi->param('payby'); $payinfo = $cgi->param('payinfo'); - $_date = $cgi->param('_date') ? str2time($cgi->param('_date')) : time; + $_date = $cgi->param('_date') ? parse_datetime($cgi->param('_date')) : time; } elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) { $link = $cgi->param('popup') ? 'popup' : 'custnum'; $linknum = $1; @@ -128,18 +133,25 @@ if ( $cgi->param('error') ) { die "illegal query ". $cgi->keywords; } +my @rights = ('Post payment'); +push @rights, 'Post check payment' if $payby eq 'BILL'; +push @rights, 'Post cash payment' if $payby eq 'CASH'; + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right(\@rights); + my $paybatch = "webui-$_date-$$-". rand() * 2**32; -my $title = 'Post '. $payby{$payby}. ' payment'; -$title .= " against Invoice #$linknum" if $link eq 'invnum'; +my $title = mt('Post '. FS::payby->payname($payby). ' payment'); +$title .= mt(" against Invoice #[_1]",$linknum) if $link eq 'invnum'; my $custnum; 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; } - +