diff options
author | ivan <ivan> | 2011-11-22 21:25:33 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-11-22 21:25:33 +0000 |
commit | 91a65629b7c2659035408bafa1f90f96b6596498 (patch) | |
tree | fec6f169b32995c21a371649beb637dfcdd199c1 /httemplate | |
parent | d01b288624d883262266afe4775367a5e0e5a328 (diff) |
fix batch browsing w/ the new agent-specific batches, RT#15310
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/search/cust_pay_batch.cgi | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/httemplate/search/cust_pay_batch.cgi b/httemplate/search/cust_pay_batch.cgi index 73ead9196..f38264410 100755 --- a/httemplate/search/cust_pay_batch.cgi +++ b/httemplate/search/cust_pay_batch.cgi @@ -60,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') @@ -108,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 ' . |