diff --git a/Layout/default/Order/Form.php b/Layout/default/Order/Form.php index df6b57189..24e3f1c0c 100644 --- a/Layout/default/Order/Form.php +++ b/Layout/default/Order/Form.php @@ -605,6 +605,7 @@
@@ -772,6 +773,7 @@
@@ -1244,7 +1246,15 @@ $('#price_setup-' + id).val(p.price_setup); $('#price_nne-' + id).val(p.price_nne); $('#price_nbe-' + id).val(p.price_nbe); - + + var period = Number.parseInt(p.billing_period); + var price = Number.parseFloat(p.price); + if(!period && !price) { + $('#price-' + id).prop("disabled", true); + } else { + $('#price-' + id).prop("disabled", false); + } + console.log(p.attributes); console.log("form_id: " + id); if(typeof p.attributes === 'object' && "termination_required" in p.attributes && p.attributes.termination_required == 1) { @@ -1266,6 +1276,7 @@ } else { $('#voicenumber-' + id + '-line').hide(); } + }, 'json'); @@ -1671,6 +1682,7 @@ \
\
\ diff --git a/Layout/default/Order/Index.php b/Layout/default/Order/Index.php index ad50c05d8..633b1d38d 100644 --- a/Layout/default/Order/Index.php +++ b/Layout/default/Order/Index.php @@ -177,9 +177,13 @@ Nur Sonderprodukte/Projekte - + diff --git a/Layout/default/Product/Form.php b/Layout/default/Product/Form.php index 46f898abb..630c6625a 100644 --- a/Layout/default/Product/Form.php +++ b/Layout/default/Product/Form.php @@ -180,7 +180,7 @@
- + billing_period && !(float)$product->price) ? "disabled='disabled'" : ""?> />
@@ -334,7 +334,18 @@ $('#producttech_form').hide(); } }); - + + $("#billing_period").change(() => { + var price = Number.parseFloat($("#price").val().replace(",",".")); + var period = Number.parseInt($("#billing_period").val()); + + if(!period && !price) { + $("#price").prop("disabled", true); + } else { + $("#price").prop("disabled", false); + } + }); + // disable mousewheel on input number field when in focus $('form').on('focus', 'input[type=number]', function (e) { $(this).on('wheel.disableScroll', function (e) { diff --git a/Layout/default/Product/Index.php b/Layout/default/Product/Index.php index 2caf94507..85a01487e 100644 --- a/Layout/default/Product/Index.php +++ b/Layout/default/Product/Index.php @@ -153,8 +153,7 @@ producttech->name?>attributes) && array_key_exists(TT_ATTRIB_RTRTECHCODE_NAME, $product->attributes)) ? " (".$product->attributes[TT_ATTRIB_RTRTECHCODE_NAME]->value.")" : "" ?> producttech->customer_type)?> price?> - billing_period, "billing_period")?> - + billing_period, "billing_period")?> sla->name?> ivt_id?>