This commit was generated by cvs2svn to compensate for changes in r6252,
[freeside.git] / httemplate / search / report_cust_credit.html
1 <% include('/elements/header.html', 'Credit report' ) %>
2
3 <FORM ACTION="cust_credit.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5
6 <TABLE>
7
8   <% include( '/elements/tr-select-otaker.html',
9                 'label'   => 'Credits by employee: ',
10                 'otakers' => \@otakers,
11             )
12   %>
13
14   <% include( '/elements/tr-select-agent.html',
15                  'curr_value' => scalar( $cgi->param('agentnum') ),
16                  'label'      => 'for agent: ',
17              )
18   %>
19
20   <% include( '/elements/tr-input-beginning_ending.html' ) %>
21
22   <% include( '/elements/tr-input-lessthan_greaterthan.html',
23                 'label' => 'Amount',
24                 'field' => 'amount',
25             )
26   %>
27
28 </TABLE>
29
30 <BR>
31 <INPUT TYPE="submit" VALUE="Get Report">
32
33 </FORM>
34
35 <% include('/elements/footer.html') %>
36
37 <%init>
38
39 die "access denied"
40   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
41
42 my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_credit")
43   or die dbh->errstr;
44 $sth->execute or die $sth->errstr;
45 my @otakers = map { $_->[0] } @{$sth->fetchall_arrayref};
46
47 </%init>