summaryrefslogtreecommitdiff
path: root/httemplate/elements/order_pkg.js
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/order_pkg.js')
-rw-r--r--httemplate/elements/order_pkg.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/httemplate/elements/order_pkg.js b/httemplate/elements/order_pkg.js
new file mode 100644
index 000000000..48073593a
--- /dev/null
+++ b/httemplate/elements/order_pkg.js
@@ -0,0 +1,46 @@
+function pkg_changed () {
+ var form = document.OrderPkgForm;
+ var discountnum = form.discountnum;
+
+ if ( form.pkgpart.selectedIndex > 0 ) {
+
+ form.submitButton.disabled = false;
+ if ( discountnum ) {
+ if ( form.pkgpart.options[form.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) {
+ form.discountnum.disabled = false;
+ discountnum_changed(form.discountnum);
+ } else {
+ form.discountnum.disabled = true;
+ discountnum_changed(form.discountnum);
+ }
+ }
+
+ if ( form.pkgpart.options[form.pkgpart.selectedIndex].getAttribute('data-can_start_date') == 1 ) {
+ form.start_date_text.disabled = false;
+ form.start_date.style.backgroundColor = '#ffffff';
+ form.start_date_button.style.display = '';
+ form.start_date_button_disabled.style.display = 'none';
+ form.invoice_terms.disabled = true;
+ } else {
+ form.start_date_text.disabled = true;
+ form.start_date.style.backgroundColor = '#dddddd';
+ form.start_date_button.style.display = 'none';
+ form.start_date_button_disabled.style.display = '';
+ }
+
+ } else {
+ form.submitButton.disabled = true;
+ if ( discountnum ) { form.discountnum.disabled = true; }
+ discountnum_changed(form.discountnum);
+ }
+}
+
+function standardize_new_location() {
+ var form = document.OrderPkgForm;
+ var loc = form.locationnum;
+ if (loc.type == 'select-one' && loc.options[loc.selectedIndex].value == -1){
+ standardize_locations();
+ } else {
+ form.submit();
+ }
+}