1 <% include('/elements/header.html', $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 <% include( '/elements/tr-select-user.html',
10 'label' => 'Credits by employee: ',
11 'access_user' => \%access_user,
15 <% include( '/elements/tr-select-agent.html',
16 'curr_value' => scalar( $cgi->param('agentnum') ),
17 'label' => 'for agent: ',
22 <% include( '/elements/tr-input-beginning_ending.html' ) %>
24 <% include( '/elements/tr-input-lessthan_greaterthan.html',
33 <INPUT TYPE="submit" VALUE="Get Report">
37 <% include('/elements/footer.html') %>
42 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
44 my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit")
46 $sth->execute or die $sth->errstr;
47 my @usernum = map $_->[0], @{$sth->fetchall_arrayref};
49 map { $_ => qsearchs('access_user',{'usernum'=>$_})->username }
52 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
54 my $title = $cgi->param('unapplied') ?
55 'Unapplied credit report' : 'Credit report';