1 <& /elements/header.html, 'Discount report' &>
3 <FORM ACTION="cust_bill_pkg_discount.html" METHOD="GET">
8 <& /elements/tr-select-discount_class.html,
9 'field' => 'discount_classnum',
10 'pre_options' => [ '0' => 'all' ],
11 'empty_label' => '(none)'
14 <& /elements/tr-select-user.html,
15 'label' => 'Discounts by employee: ',
16 'access_user' => \%access_user,
19 <& /elements/tr-select-agent.html,
20 'curr_value' => scalar( $cgi->param('agentnum') ),
21 'label' => 'for agent: ',
25 <& /elements/tr-input-beginning_ending.html &>
27 <!-- doesn't actually work yet, needs support in cust_bill_pkg_discount.html
28 <& /elements/tr-input-lessthan_greaterthan.html,
37 <INPUT TYPE="submit" VALUE="Get Report">
41 <& /elements/footer.html &>
45 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
47 my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_pkg_discount")
49 $sth->execute or die $sth->errstr;
50 my @usernum = map $_->[0], @{$sth->fetchall_arrayref};
52 map { $_ => qsearchs('access_user',{'usernum'=>$_})->username }