X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-discount.html;h=3a267ed08dbd08a7516e4689f7aa7edc74ab6d5e;hp=e0b6e6cbe5712bb4037c8631cc9caa337816ff7d;hb=8fe6c833babe44bb707b8c47273b04fe39edfbaf;hpb=2d5f9e43a60773a9b079e96c330cb9e0e089800a diff --git a/httemplate/elements/select-discount.html b/httemplate/elements/select-discount.html index e0b6e6cbe..3a267ed08 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' => $hashref, + 'post_options' => $post_options, %opt, ) %> @@ -16,5 +17,14 @@ my $discountnum = $opt{'curr_value'} || $opt{'value'}; $opt{'records'} = delete $opt{'discount'} if $opt{'discount'}; +my $curuser = $FS::CurrentUser::CurrentUser; + +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}; +