X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_pay.cgi;h=a203e91317c3e1270ff2dee76559a49798db2902;hp=cc4ec605dee2e596b5360a72a2d63c14b062a85b;hb=44ed8f67ced13b6c2d4298577652243fe2eee453;hpb=2ab068f449eb97a10e18d20e9dab5ab9faa017e7 diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index cc4ec605d..a203e9131 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -1,83 +1,107 @@ % if ( $link eq 'popup' ) { - <% include('/elements/header-popup.html', $title ) %> + <& /elements/header-popup.html, $title &> % } else { - <% include("/elements/header.html", $title, '') %> + <& /elements/header-cust_main.html, view=>'payment_history', custnum=>$custnum &> +

<% $title |h %>

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

- -Payment +<% mt('Payment') |h %> <% ntable("#cccccc", 2) %> - - Date - - - - - +% my %date_args = ( +% 'name' => '_date', +% 'label' => emt('Date'), +% 'value' => $_date, +% 'format' => $date_format. ' %r', +% 'colspan' => 2, +% ); +% if ( $FS::CurrentUser::CurrentUser->access_right('Backdate payment') ) { - + <& /elements/tr-input-date-field.html, \%date_args &> + +% } else { + + <& /elements/tr-fixed-date.html, \%date_args &> + +% } - Amount - <% $money_char %> - by <% FS::payby->payname($payby) %> + <% mt('Amount') |h %> + <% $money_char |h %> <% mt('by') |h %> <% mt(FS::payby->payname($payby)) |h %> +% if ( $conf->exists('part_pkg-term_discounts') ) { + <& /elements/tr-select-discount_term.html, + 'custnum' => $custnum, + 'amount_id' => 'paid', + &> +% } + % if ( $payby eq 'BILL' ) { - Check # + <% mt('Check #') |h %> -% } +% } +% elsif ( $payby eq 'CASH' and $conf->exists('require_cash_deposit_info') ) { + + <% mt('Bank') |h %> + + + + <% mt('Check #') |h %> + + + + <% mt('Teller #') |h %> + + + + <% mt('Depositor') |h %> + + + + <% mt('Account #') |h %> + + +% } % if ( $link eq 'custnum' || $link eq 'popup' ) { - Auto-apply
to invoices + <% mt('Auto-apply to invoices') |h %> - + + + + + % } elsif ( $link eq 'invnum' ) { - Apply to + <% mt('Apply to') |h %> Invoice #<% $linknum %> only - + % } % if ( $conf->exists('pkg-balances') ) { - <% include('/elements/tr-select-cust_pkg-balances.html', + <& /elements/tr-select-cust_pkg-balances.html, 'custnum' => $custnum, 'cgi' => $cgi - ) - %> + &> % } else { % } @@ -85,7 +109,7 @@ Payment
- +
@@ -93,7 +117,7 @@ Payment % } else { - <% include('/elements/footer.html') %> + <& /elements/footer-cust_main.html &> % } <%init> @@ -103,9 +127,6 @@ my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; -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'); @@ -132,10 +153,17 @@ 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 '. FS::payby->payname($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' ) {