diff options
author | ivan <ivan> | 2010-01-30 20:05:16 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-01-30 20:05:16 +0000 |
commit | d6be23266fb627a4e7831055bf55ae675dbad4e9 (patch) | |
tree | 8fb86afdd53f5b1dee3534f4515836e9fb4fdbfe /httemplate/misc | |
parent | 2d5f9e43a60773a9b079e96c330cb9e0e089800a (diff) |
discounts, RT#6679
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') ) { |