X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_cust_credit.html;h=16a75ebf495408e9e29067d6cd0d7b8952d0d0e5;hb=636dd1f25af52d35efe7a323a5765ff5adeadf83;hp=9932097639478c76768e860c5b8e6d43080b8487;hpb=590603ecaea3184f64530755a76626be8205da49;p=freeside.git diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html index 993209763..16a75ebf4 100644 --- a/httemplate/search/report_cust_credit.html +++ b/httemplate/search/report_cust_credit.html @@ -1,25 +1,21 @@ -<% include('/elements/header.html', 'Credit report' ) %> +<% include('/elements/header.html', $title ) %>
+ - - - - - + + <% include( '/elements/tr-select-user.html', + 'label' => 'Credits by employee: ', + 'access_user' => \%access_user, + ) + %> <% include( '/elements/tr-select-agent.html', - $cgi->param('agentnum'), - 'label' => 'for agent: ', + 'curr_value' => scalar( $cgi->param('agentnum') ), + 'label' => 'for agent: ', + 'disable_empty' => 0, ) %> @@ -45,9 +41,17 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_credit") +my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit") or die dbh->errstr; $sth->execute or die $sth->errstr; -my @otakers = map { $_->[0] } @{$sth->fetchall_arrayref}; +my @usernum = map $_->[0], @{$sth->fetchall_arrayref}; +my %access_user = + map { $_ => qsearchs('access_user',{'usernum'=>$_})->username } + @usernum; + +my $unapplied = $cgi->param('unapplied') ? 1 : 0; + +my $title = $cgi->param('unapplied') ? + 'Unapplied credit report' : 'Credit report';
Credits by employee: - -