X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fbatch-cust_pay.html;h=c5ed6d85280e7bb69e76b86cabaa505ab418d881;hb=74e058c8a010ef6feb539248a550d0bb169c1e94;hp=41537ee7e5691597d570e65f5d3270f637b3f4cf;hpb=2c757d7db4cb6a7b9655de13206fcc84fb7ce61f;p=freeside.git diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html index 41537ee7e..c5ed6d852 100644 --- a/httemplate/misc/batch-cust_pay.html +++ b/httemplate/misc/batch-cust_pay.html @@ -1,298 +1,77 @@ -<%= include("/elements/header.html", 'Quick payment entry', - menubar( - 'Main Menu' => $p, #popurl(1), - ), - ( $cgi->param('error') ? '' : 'onload="addRow()"' ), - ) -%> - -<% if ( $cgi->param('error') ) { %> - <%= $cgi->param('error') %>

-<% } %> - +<% include('/elements/header.html', 'Quick payment entry') %> -
- - +<% include('/elements/error.html') %> - - - - - - - - - - -<% my $row = 0; - if ( $cgi->param('error') ) { - my $param = $cgi->Vars; +<% include('/elements/xmlhttp.html', + 'url' => $p. 'misc/xmlhttp-cust_main-discount_terms.cgi', + 'subs' => [qw( discount_terms )], + ) %> - <% for ( $row = 0; exists($param->{"custnum$row"}); $row++ ) { %> - - - - - - - - - - - - - - + - <% } %> - -<% } %> + -
Cust #CustomerAmountCheck #
- " rownum="<%= $row %>"> - - - " rownum="<%= $row %>"> - - - - - $" > - - " > - - <% if ( $param->{"error$row"} ) { %> - Error: <%= $param->{"error$row"} %> - <% } %> -
+<% include( "/elements/customer-table.html", + name_singular => 'payment', + header => \@header, + fields => \@fields, + types => \@types, + align => \@align, + sizes => \@sizes, + colors => \@colors, + param => \%param, + footer => \@footer, + footer_align => \@footer_align, + custnum_update_callback => $custnum_update_callback, + ) +%> @@ -302,93 +81,53 @@
- -<%= include('/elements/xmlhttp.html', - 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', - 'subs' => [qw( custnum_search smart_search )], - ) -%> - +%if ( $cgi->param('error') ) { - - - +%} + +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Post payment batch'); + +my @header = ( '', 'Amount', 'Check #' ); +my @fields = ( sub {'$'}, 'paid', 'payinfo' ); +my @types = ( 'immutable', '', '' ); +my @align = ( 'c', 'r', 'r' ); +my @sizes = ( 0, 8, 10 ); +my @colors = ( '', '', '' ); +my %param = (); +my @footer = ( '$', '_TOTAL', '' ); +my @footer_align = ( 'c', 'r', 'r' ); +my $custnum_update_callback = ''; + +if ( FS::Record->scalar_sql('SELECT COUNT(*) FROM part_pkg_discount') ) { + push @header, ''; + push @fields, 'discount_term'; + push @types, 'immutable'; + push @align, 'r'; + push @sizes, '0'; + push @colors, ''; + push @footer, ''; + push @footer_align, ''; + $custnum_update_callback = 'select_discount_term'; +} + +push @header, ''; +push @fields, 'error'; +push @types, 'immutable'; +push @align, 'l'; +push @sizes, '0'; +push @colors, '#ff0000'; +push @footer, ''; +push @footer_align, ''; + +$m->comp('/elements/handle_uri_query'); + +