summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2011-11-22 21:25:32 +0000
committerivan <ivan>2011-11-22 21:25:32 +0000
commit6b422c02045e73bac0e0c73553da62a99a9698a4 (patch)
treecf2484d6e09abfd763da01548ede79db78c82048 /httemplate
parentee48f55cdc11b2573f66234b6077d4c2c6ceb4d0 (diff)
fix batch browsing w/ the new agent-specific batches, RT#15310
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/search/cust_pay_batch.cgi10
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 ' .