1 <& /elements/header.html, mt($title) &>
3 <FORM ACTION="cust_credit.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5 <INPUT TYPE="hidden" NAME="unapplied" VALUE="<% $unapplied %>">
9 <& /elements/tr-select-user.html,
10 'label' => emt('Credits by employee: '),
11 'access_user' => \%access_user,
14 <& /elements/tr-select-agent.html,
15 'curr_value' => scalar( $cgi->param('agentnum') ),
16 'label' => emt('for agent: '),
20 <& /elements/tr-input-beginning_ending.html &>
22 <& /elements/tr-input-lessthan_greaterthan.html,
23 'label' => emt('Amount'),
30 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
34 <& /elements/footer.html &>
39 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
41 my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit")
43 $sth->execute or die $sth->errstr;
44 my @usernum = map $_->[0], @{$sth->fetchall_arrayref};
46 map { $_ => qsearchs('access_user',{'usernum'=>$_})->username }
49 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
51 my $title = $cgi->param('unapplied') ?
52 'Unapplied credit report' : 'Credit report';