RT#27710: Credit voiding
[freeside.git] / httemplate / search / report_cust_credit_void.html
1 <& /elements/header.html, mt($title) &>
2
3 <FORM ACTION="cust_credit_void.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5
6 <TABLE>
7
8   <& /elements/tr-select-user.html,
9                 'label'       => emt('Credit voids by employee: '),
10                 'access_user' => \%access_user,
11   &>
12
13   <& /elements/tr-select-agent.html,
14                  'curr_value'    => scalar( $cgi->param('agentnum') ),
15                  'label'         => emt('for agent: '),
16                  'disable_empty' => 0,
17   &>
18
19   <& /elements/tr-input-beginning_ending.html &>
20
21   <& /elements/tr-input-lessthan_greaterthan.html,
22                 'label' => emt('Amount'),
23                 'field' => 'amount',
24   &>
25
26 </TABLE>
27
28 <BR>
29 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
30
31 </FORM>
32
33 <& /elements/footer.html &>
34
35 <%init>
36
37 die "access denied"
38   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
39
40 my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit_void")
41   or die dbh->errstr;
42 $sth->execute or die $sth->errstr;
43 my @usernum = map $_->[0], @{$sth->fetchall_arrayref};
44 my %access_user =
45   map { $_ => qsearchs('access_user',{'usernum'=>$_})->username }
46       @usernum;
47
48 my $title = 'Voided credit report';
49
50 </%init>