summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-discount.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/select-discount.html')
-rw-r--r--httemplate/elements/select-discount.html20
1 files changed, 14 insertions, 6 deletions
diff --git a/httemplate/elements/select-discount.html b/httemplate/elements/select-discount.html
index e0b6e6cbe..b7f1fa5be 100644
--- a/httemplate/elements/select-discount.html
+++ b/httemplate/elements/select-discount.html
@@ -1,10 +1,11 @@
<% 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,
)
%>
@@ -16,5 +17,12 @@ my $discountnum = $opt{'curr_value'} || $opt{'value'};
$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>