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