From 4ad0db07e8943ecd5ba9c9210124108c3e21d7dd Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Tue, 4 Feb 2020 18:39:14 +0800 Subject: [PATCH] Add new customer option enabling customer and vehicle fields #319 --- .../job-order/cmb.form.onestep.html.twig | 69 ++++++++++++------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/templates/job-order/cmb.form.onestep.html.twig b/templates/job-order/cmb.form.onestep.html.twig index 8e4ac45d..4db34a48 100644 --- a/templates/job-order/cmb.form.onestep.html.twig +++ b/templates/job-order/cmb.form.onestep.html.twig @@ -75,20 +75,27 @@ {% endif %}
-
+

Customer Details

+ + +
- +
- +
@@ -97,7 +104,7 @@
{% trans %}country_code_prefix{% endtrans %} - +
@@ -105,7 +112,7 @@
{% trans %}country_code_prefix{% endtrans %} - +
@@ -115,7 +122,7 @@
{% trans %}country_code_prefix{% endtrans %} - +
@@ -123,7 +130,7 @@
{% trans %}country_code_prefix{% endtrans %} - +
@@ -131,7 +138,7 @@
- +
@@ -144,33 +151,35 @@
- - - + + +
- - - + + +
- - - + + + +
+
+ + +
+
@@ -1123,6 +1132,20 @@ $(function() { } }).change(); + // toggle new customer + $("#flag-new-customer").change(function() { + console.log('HERE'); + + checked = $(this).prop('checked'); + if (checked) { + $('.cust_field').prop('disabled', false); + $('.cv_field').prop('disabled', false); + } else { + $('.cust_field').prop('disabled', true); + $('.cv_field').prop('disabled', true); + } + }).change(); + // update battery list when changing manufacturer $("#invoice-bmfg").change(function() { {% if ftags.preset_vehicle %}