Merge branch '150-jo-bug-fixing' into 'master'

Resolve "JO bug fixing"

Closes #150

See merge request jankstudio/resq!151
This commit is contained in:
Kendrick Chan 2018-06-21 18:34:32 +00:00
commit 128dd352d9
2 changed files with 10 additions and 4 deletions

View file

@ -276,7 +276,8 @@ class JobOrderController extends BaseController
// did they change invoice?
$invoice_items = $req->request->get('invoice_items');
if (!empty($invoice_items))
$invoice_change = $req->request->get('invoice_change', 0);
if ($invoice_change)
{
// instantiate invoice criteria
$criteria = new InvoiceCriteria();

View file

@ -45,6 +45,7 @@
</div>
</div>
<form id="row-form" class="m-form m-form--fit m-form--label-align-right" method="post" action="{{ submit_url }}">
<input type="hidden" id="invoice-change" name="invoice_change" value="0">
<div class="m-portlet__body">
{% if ftags.vehicle_dropdown %}
@ -72,8 +73,8 @@
</div>
</div>
</div>
{% elseif cvid|default(false) %}
<input type="hidden" name="customer_vehicle" value="{{ cvid }}">
{% else %}
<input type="hidden" id="customer-vehicle" name="customer_vehicle" value="{{ obj.getCustomerVehicle.getID|default('0') }}">
{% endif %}
{% if obj.getReferenceJO %}
<div class="m-form__section m-form__section--first">
@ -383,7 +384,7 @@
</div>
</div>
<div class="m-form__seperator m-form__seperator--dashed"></div>
<div class="m-form__section{{ ftags.invoice_edit ? ' m-form__section--last' }}">
<div class="m-form__section{{ ftags.invoice_edit ? ' m-form__section--last' }}">>
<div class="m-form__heading">
<h3 class="m-form__heading-title">
Invoice
@ -994,6 +995,7 @@ $(function() {
// store selected vehicle data
var vdata = false;
{% if ftags.vehicle_dropdown %}
// vehicle selector
$('#customer-vehicle').select2({
ajax: {
@ -1054,6 +1056,7 @@ $(function() {
}
})
}).focus();
{% endif %}
{% if ftags.vehicle_dropdown %}
// reference job order selector
@ -1259,6 +1262,8 @@ $(function() {
'cvid': cvid
}
}).done(function(response) {
// mark as invoice changed
$("#invoice-change").val(1);
var invoice = response.invoice;
// populate totals