summaryrefslogtreecommitdiff
path: root/httemplate/search/report_cust_credit.html
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-03-04 18:33:52 -0600
committerJonathan Prykop <jonathan@freeside.biz>2015-03-09 21:27:57 -0500
commit64489396dd98a369aa2c38d3802400c2c508f136 (patch)
treeaf1cc7073d003089997aa6dd88a678ba352807a2 /httemplate/search/report_cust_credit.html
parenta4b5a3e0da1e747e5937be1cc69841158743f8a9 (diff)
RT#22952: Employee drop down list in reports shows employee users for all agents
Diffstat (limited to 'httemplate/search/report_cust_credit.html')
-rw-r--r--httemplate/search/report_cust_credit.html10
1 files changed, 2 insertions, 8 deletions
diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html
index dbab66ae5..0d7a2770a 100644
--- a/httemplate/search/report_cust_credit.html
+++ b/httemplate/search/report_cust_credit.html
@@ -8,7 +8,7 @@
<& /elements/tr-select-user.html,
'label' => emt('Credits by employee: '),
- 'access_user' => \%access_user,
+ 'access_user' => $access_user,
&>
<& /elements/tr-select-agent.html,
@@ -38,13 +38,7 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
-my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit")
- or die dbh->errstr;
-$sth->execute or die $sth->errstr;
-my @usernum = map $_->[0], @{$sth->fetchall_arrayref};
-my %access_user =
- map { $_ => qsearchs('access_user',{'usernum'=>$_})->username }
- @usernum;
+my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_credit');
my $unapplied = $cgi->param('unapplied') ? 1 : 0;