X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-discount.html;h=3a267ed08dbd08a7516e4689f7aa7edc74ab6d5e;hp=b7f1fa5bea89572f06dff24843161d10d770b8fe;hb=fe32569659388d3edbd08fe2b1327ec0005da4f8;hpb=5a1e08844db8e4278105f0aad7aa3a48a433789c 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};