X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fpay_batch.cgi;h=29a612568ed2ae2b0840c49b378082a895130107;hb=e310ed83422fee8511df926141a7606676ff1331;hp=6d571b42fdb5794f132c96bcbae4f90503f25159;hpb=033709735189caa804476fc17e9946809516fcf7;p=freeside.git diff --git a/httemplate/search/pay_batch.cgi b/httemplate/search/pay_batch.cgi index 6d571b42f..29a612568 100755 --- a/httemplate/search/pay_batch.cgi +++ b/httemplate/search/pay_batch.cgi @@ -1,4 +1,4 @@ -<% include( 'elements/search.html', +<& elements/search.html, 'title' => 'Payment Batches', 'name_singular' => 'batch', 'query' => { 'table' => 'pay_batch', @@ -7,6 +7,9 @@ 'order_by' => 'ORDER BY batchnum DESC', }, 'count_query' => "$count_query $extra_sql", + 'agent_virt' => 1, + 'agent_null_right' => 'Process batches', #'Process global batches', + 'agent_pos' => 1, 'header' => [ 'Batch', 'Type', 'First Download', @@ -80,9 +83,9 @@ sub { shift->status eq 'O' ? "b" : '' }, sub { shift->status eq 'I' ? "b" : '' }, ], - ) - -%> + 'html_init' => $html_init, + +&> <%init> die "access denied" @@ -96,16 +99,10 @@ my $count_query = 'SELECT COUNT(*) FROM pay_batch'; my($begin, $end) = ( '', '' ); my @where; -if ( $cgi->param('beginning') - && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) { - $begin = parse_datetime($1); - push @where, "download >= $begin"; -} -if ( $cgi->param('ending') - && $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/ ) { - $end = parse_datetime($1) + 86399; - push @where, "download < $end"; -} + +my($beginning,$ending) = FS::UI::Web::parse_beginning_ending($cgi); +push @where, "( (download >= $beginning AND download <= $ending)". + ' OR download IS NULL )'; my @status; if ( $cgi->param('open') ) { @@ -128,4 +125,9 @@ my $extra_sql = scalar(@where) ? 'WHERE ' . join(' AND ', @where) : ''; my $link = [ "${p}search/cust_pay_batch.cgi?dcln=1;batchnum=", 'batchnum' ]; +my $resolved = $cgi->param('resolved') || 0; +$cgi->param('resolved' => !$resolved); +my $html_init = ''. + ($resolved ? 'Hide' : 'Show') . ' resolved batches
'; +