summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-04-27 15:31:10 -0700
committerIvan Kohler <ivan@freeside.biz>2017-04-27 15:31:10 -0700
commitd61184afa40f5b99b7b27816d7f372588b215bd8 (patch)
tree51fbd20533ef9b736d43708784fe923c985a60f5 /httemplate
parent2beb8b0c6b404765e1e061b77815dc9123114c94 (diff)
discount action UI improvements: don't show 'Custom discount' which we can't add on the fly, RT#75536
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/select-discount.html12
1 files changed, 7 insertions, 5 deletions
diff --git a/httemplate/elements/select-discount.html b/httemplate/elements/select-discount.html
index b7f1fa5be..3a267ed08 100644
--- a/httemplate/elements/select-discount.html
+++ b/httemplate/elements/select-discount.html
@@ -4,7 +4,7 @@
'order_by' => 'ORDER BY discountnum', #XXX weight
'value' => $discountnum,
'empty_label' => '(none)',
- 'hashref' => { 'disabled' => '' },
+ 'hashref' => $hashref,
'post_options' => $post_options,
%opt,
)
@@ -19,10 +19,12 @@ $opt{'records'} = delete $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' ]
- : [];
+my $hashref = $opt{hashref} || { 'disabled' => '' };
+
+my $post_options = [];
+push @$post_options, -1 => 'Custom discount'
+ if $curuser->access_right('Custom discount customer package')
+ && ! $opt{disable_custom_discount};
</%init>