add legacy_cust_bill to hold legacy invoice content, RT#12981
[freeside.git] / httemplate / elements / select-discount.html
1 <% include( '/elements/select-table.html',
2                  'table'        => 'discount',
3                  'name_col'     => 'description',
4                  'order_by'     => 'ORDER BY discountnum', #XXX weight
5                  'value'        => $discountnum,
6                  'empty_label'  => '(none)',
7                  'hashref'      => { 'disabled' => '' },
8                  'post_options' => $post_options,
9                  %opt,
10              )
11 %>
12 <%init>
13
14 my %opt = @_;
15 my $discountnum = $opt{'curr_value'} || $opt{'value'};
16
17 $opt{'records'} = delete $opt{'discount'}
18   if $opt{'discount'};
19
20 my $curuser = $FS::CurrentUser::CurrentUser;
21
22 #make an opt if we need to turn this off
23 my $post_options = $curuser->access_right('Custom discount customer package')
24   ? [ -1 => 'Custom discount' ]
25   : [];
26
27 </%init>
28