diff options
Diffstat (limited to 'httemplate/misc')
-rw-r--r-- | httemplate/misc/cust-part_pkg.cgi | 2 | ||||
-rw-r--r-- | httemplate/misc/order_pkg.html | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/httemplate/misc/cust-part_pkg.cgi b/httemplate/misc/cust-part_pkg.cgi index 974ac0e87..524799ced 100644 --- a/httemplate/misc/cust-part_pkg.cgi +++ b/httemplate/misc/cust-part_pkg.cgi @@ -23,7 +23,7 @@ my @part_pkg = qsearch({ 'order_by' => 'ORDER BY pkg', }); -my @return = map { $_->pkgpart => $_->pkg_comment } +my @return = map { ( $_->pkgpart, $_->pkg_comment, $_->can_discount ); } #sort { $a->pkg_comment cmp $b->pkg_comment } @part_pkg; diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index 684f94e7c..e05205ba7 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -10,8 +10,14 @@ function enable_order_pkg () { if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) { document.OrderPkgForm.submit.disabled = false; + if ( document.OrderPkgForm.pkgpart.options[document.OrderPkgForm.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) { + document.OrderPkgForm.discountnum.disabled = false; + } else { + document.OrderPkgForm.discountnum.disabled = true; + } } else { document.OrderPkgForm.submit.disabled = true; + document.OrderPkgForm.discountnum.disabled = true; } } @@ -61,7 +67,10 @@ </SCRIPT> % if ( $curuser->access_right('Discount customer package') ) { - <% include('/elements/tr-select-discount.html') %> + <% include('/elements/tr-select-discount.html', + 'element_etc' => 'DISABLED', + ) + %> % } % if ( $conf->exists('pkg_referral') ) { |