X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_pay_batch.cgi;h=f3826441058397e5a6ef2efcafdf747d48e39f9b;hb=b6dbe0f12dbbe4ea5209367f905f937789b5b607;hp=8022d46668100eb5857ea522cd785f392c972602;hpb=f8b35040badefb02652f875e147ee2b4b2f7c4a9;p=freeside.git diff --git a/httemplate/search/cust_pay_batch.cgi b/httemplate/search/cust_pay_batch.cgi index 8022d4666..f38264410 100755 --- a/httemplate/search/cust_pay_batch.cgi +++ b/httemplate/search/cust_pay_batch.cgi @@ -3,10 +3,8 @@ 'name' => 'batch details', 'query' => $sql_query, 'count_query' => $count_query, - 'html_init' => $pay_batch ? - include('elements/cust_pay_batch_top.html', - 'pay_batch' => $pay_batch - ) : '', + 'html_init' => $pay_batch ? $html_init : '', + 'disable_download' => 1, 'header' => [ '#', 'Inv #', 'Customer', @@ -62,9 +60,12 @@ my $conf = new FS::Conf; +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Financial reports') - || $FS::CurrentUser::CurrentUser->access_right('Process batches') + unless $curuser->access_right('Financial reports') + || $curuser->access_right('Process batches') + || $curuser->access_right('Process global batches') || ( $cgi->param('custnum') && ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') @@ -110,7 +111,8 @@ unless ($pay_batch){ $orderby = "pay_batch.download,paybatchnum"; } -push @search, $FS::CurrentUser::CurrentUser->agentnums_sql; +push @search, $curuser->agentnums_sql({ table=>'cust_main' }); + my $search = ' WHERE ' . join(' AND ', @search); $count_query = 'SELECT COUNT(*) FROM cust_pay_batch AS cpb ' .