event action to send a notice to a fixed address, RT#8209
[freeside.git] / httemplate / search / report_cust_pkg_discount.html
1 <% include('/elements/header.html', 'Package discount report' ) %>
2
3 <FORM ACTION="cust_pkg_discount.html" METHOD="GET">
4
5
6 <TABLE>
7
8   <TR>
9     <TD>Discount status</TD>
10     <TD>
11       <SELECT NAME="status">
12         <OPTION VALUE="active">Active
13         <OPTION VALUE="expired">Expired
14         <OPTION VALUE="">(all)
15       </SELECT>
16     </TD>
17   </TR>
18
19   <% include( '/elements/tr-select-user.html',
20                 'label'       => 'Discounts by employee: ',
21                 'access_user' => \%access_user,
22             )
23   %>
24
25   <% include( '/elements/tr-select-agent.html',
26                  'curr_value'    => scalar( $cgi->param('agentnum') ),
27                  'label'         => 'for agent: ',
28                  'disable_empty' => 0,
29              )
30   %>
31
32 </TABLE>
33
34 <BR>
35 <INPUT TYPE="submit" VALUE="Get Report">
36
37 </FORM>
38
39 <% include('/elements/footer.html') %>
40 <%init>
41
42 die "access denied"
43   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
44
45 my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_pkg_discount")
46   or die dbh->errstr;
47 $sth->execute or die $sth->errstr;
48 my @usernum = map $_->[0], @{$sth->fetchall_arrayref};
49 my %access_user =
50   map { $_ => qsearchs('access_user',{'usernum'=>$_})->username }
51       @usernum;
52
53 </%init>