Autopopulate the OR Name field with the customer name. #434
This commit is contained in:
parent
6e07e24e93
commit
c3487358f1
3 changed files with 29 additions and 15 deletions
|
|
@ -350,7 +350,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setTier2Notes($req->request->get('tier2_notes'))
|
||||
->setDeliveryAddress($req->request->get('delivery_address'))
|
||||
->setORName($req->request->get('or_name'))
|
||||
//->setPromoDetail($req->request->get('promo_detail'))
|
||||
->setPromoDetail($req->request->get('promo_detail', ''))
|
||||
->setModeOfPayment($req->request->get('mode_of_payment'))
|
||||
->setLandmark($req->request->get('landmark'));
|
||||
|
||||
|
|
@ -554,11 +554,12 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
|
||||
// get discount and set to meta
|
||||
$discount = $req->request->get('invoice_discount', []);
|
||||
|
||||
// check if discount is greater than 50 or negative number
|
||||
if (($discount > 50) || ($discount < 0))
|
||||
$discount = $req->request->get('invoice_discount');
|
||||
|
||||
if (($discount > 60) || ($discount < 0))
|
||||
{
|
||||
$error_array['invoice_discount'] = 'Invalid discount specified';
|
||||
}
|
||||
|
||||
// get list of service charges
|
||||
$service_charges = $req->request->get('service_charges', []);
|
||||
|
|
@ -599,7 +600,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setTier2Notes($req->request->get('tier2_notes'))
|
||||
->setDeliveryAddress($req->request->get('delivery_address'))
|
||||
->setORName($req->request->get('or_name'))
|
||||
//->setPromoDetail($req->request->get('promo_detail'))
|
||||
->setPromoDetail($req->request->get('promo_detail', ''))
|
||||
->setModeOfPayment($req->request->get('mode_of_payment'))
|
||||
->setLandmark($req->request->get('landmark'))
|
||||
->setHub($hub)
|
||||
|
|
@ -2673,7 +2674,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setTier1Notes($req->request->get('tier1_notes'))
|
||||
->setTier2Notes($req->request->get('tier2_notes'))
|
||||
->setORName($req->request->get('or_name'))
|
||||
//->setPromoDetail($req->request->get('promo_detail'))
|
||||
->setPromoDetail($req->request->get('promo_detail', ''))
|
||||
->setModeOfPayment($req->request->get('mode_of_payment'))
|
||||
->setLandmark($req->request->get('landmark'))
|
||||
->setDeliveryAddress('Walk-in')
|
||||
|
|
|
|||
|
|
@ -644,13 +644,11 @@
|
|||
<input type="text" name="or_name" id="or_name" class="form-control m-input" value="{{ obj.getORName|default('') }}">
|
||||
<div class="form-control-feedback hide" data-field="or_name"></div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="col-lg-6">
|
||||
<div style="display:none" class="col-lg-6">
|
||||
<label data-field="promo_detail">Employee ID / Card Number / Referred By</label>
|
||||
<input type="text" name="promo_detail" id="promo_detail" class="form-control m-input" value="{{ obj.getPromoDetail|default('') }}">
|
||||
<div class="form-control-feedback hide" data-field="promo_detail"></div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
|
|
@ -660,7 +658,7 @@
|
|||
<option value=""></option>
|
||||
{% for discount in discounts %}
|
||||
{% if obj.getInvoice %}
|
||||
<option value="{{ discount }}"{{ obj.getInvoice.getDiscount|number_format(0) == discount ? ' selected' }}>{{ discount }}</option>
|
||||
<option value="{{ discount }}"{{ obj.getInvoice.getDiscount|number_format(2) == discount ? ' selected' }}>{{ discount }}</option>
|
||||
{% else %}
|
||||
<option value="{{ discount }}">{{ discount }}</option>
|
||||
{% endif %}
|
||||
|
|
@ -672,12 +670,13 @@
|
|||
<option value=""></option>
|
||||
{% for discount in discounts %}
|
||||
{% if obj.getInvoice %}
|
||||
<option value="{{ discount }}"{{ obj.getInvoice.getDiscount == discount ? ' selected' }} disabled>{{ discount }}</option>
|
||||
<option value="{{ discount }}"{{ obj.getInvoice.getDiscount|number_format(2) == discount ? ' selected' }} disabled>{{ discount }}</option>
|
||||
{% else %}
|
||||
<option value="{{ discount }}" disabled>{{ discount }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-control-feedback hide" data-field="invoice_discount"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
|
|
@ -1359,6 +1358,7 @@ $(function() {
|
|||
} else {
|
||||
$("#current-battery, #warranty-expiration").val("No current battery").css('color', '#f4516c');
|
||||
}
|
||||
$("#or_name").val(vdata.customer.first_name + ' ' + vdata.customer.last_name);
|
||||
})
|
||||
}).focus();
|
||||
{% endif %}
|
||||
|
|
@ -1582,6 +1582,7 @@ $(function() {
|
|||
|
||||
// update invoice when promo is changed
|
||||
$("#invoice-discount").change(function() {
|
||||
console.log('discount ' + $("#invoice-discount").val());
|
||||
generateInvoice();
|
||||
});
|
||||
|
||||
|
|
@ -1926,6 +1927,12 @@ $(function() {
|
|||
generateInvoice();
|
||||
});
|
||||
|
||||
$("#customer-first-name, #customer-last-name").change(function() {
|
||||
// autopopulate OR name with customer name
|
||||
var cust_name = $("#customer-first-name").val() + ' ' + $("#customer-last-name").val();
|
||||
$("#or_name").val(cust_name);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -392,13 +392,11 @@
|
|||
<input type="text" name="or_name" id="or_name" class="form-control m-input" value="{{ obj.getORName|default('') }}">
|
||||
<div class="form-control-feedback hide" data-field="or_name"></div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="col-lg-6">
|
||||
<div style="display:none" class="col-lg-6">
|
||||
<label data-field="promo_detail">Employee ID / Card Number / Referred By</label>
|
||||
<input type="text" name="promo_detail" id="promo_detail" class="form-control m-input" value="{{ obj.getPromoDetail|default('') }}">
|
||||
<div class="form-control-feedback hide" data-field="promo_detail"></div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
|
|
@ -741,6 +739,8 @@ var vdata = false;
|
|||
} else {
|
||||
$("#current-battery, #warranty-expiration").val("No current battery").css('color', '#f4516c');
|
||||
}
|
||||
|
||||
$("#or_name").val(vdata.customer.first_name + ' ' + vdata.customer.last_name);
|
||||
})
|
||||
}).focus();
|
||||
{% endif %}
|
||||
|
|
@ -1107,6 +1107,12 @@ var vdata = false;
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
$("#customer-first-name, #customer-last-name").change(function() {
|
||||
// autopopulate OR name with customer name
|
||||
var cust_name = $("#customer-first-name").val() + ' ' + $("#customer-last-name").val();
|
||||
$("#or_name").val(cust_name);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue