<% include( '/elements/select-table.html',
- 'table' => 'discount',
- 'name_col' => 'description',
- 'order_by' => 'ORDER BY discountnum', #XXX weight
- 'value' => $discountnum,
- 'empty_label' => '(none)',
- 'hashref' => { 'disabled' => '' },
+ 'table' => 'discount',
+ 'name_col' => 'description',
+ 'order_by' => 'ORDER BY discountnum', #XXX weight
+ 'value' => $discountnum,
+ 'empty_label' => '(none)',
+ 'hashref' => { 'disabled' => '' },
+ 'post_options' => $post_options,
%opt,
)
%>
$opt{'records'} = delete $opt{'discount'}
if $opt{'discount'};
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+#make an opt if we need to turn this off
+my $post_options = $curuser->access_right('Custom discount customer package')
+ ? [ -1 => 'Custom discount' ]
+ : [];
+
</%init>