Fix issue of sealant and coolant fee not displaying in open edit form. #811
This commit is contained in:
parent
1b24e68f6b
commit
dedfb58a28
3 changed files with 30 additions and 1 deletions
|
|
@ -754,6 +754,8 @@ class JobOrderController extends Controller
|
|||
$promo_id = $req->request->get('promo');
|
||||
$cvid = $req->request->get('cvid');
|
||||
$service_charges = $req->request->get('service_charges', []);
|
||||
$flag_coolant = $req->request->get('flag_coolant', false);
|
||||
$flag_sealant = $req->request->get('flag_sealant', false);
|
||||
|
||||
// coordinates
|
||||
// need to check if lng and lat are set
|
||||
|
|
@ -784,7 +786,9 @@ class JobOrderController extends Controller
|
|||
->setCustomerVehicle($cv)
|
||||
->setIsTaxable()
|
||||
->setSource(TransactionOrigin::CALL)
|
||||
->setPriceTier($price_tier);
|
||||
->setPriceTier($price_tier)
|
||||
->setHasCoolant($flag_coolant)
|
||||
->setHasSealant($flag_sealant);
|
||||
|
||||
/*
|
||||
// if it's a jumpstart or troubleshoot only, we know what to charge already
|
||||
|
|
|
|||
|
|
@ -69,6 +69,14 @@ class InvoiceManager implements InvoiceGeneratorInterface
|
|||
->setCustomerVehicle($jo->getCustomerVehicle())
|
||||
->setPriceTier($price_tier);
|
||||
|
||||
if (($jo->getServiceType() == ServiceType::OVERHEAT_ASSISTANCE) &&
|
||||
($jo->hasCoolant()))
|
||||
$criteria->setHasCoolant(true);
|
||||
|
||||
if (($jo->getServiceType() == ServiceType::TIRE_REPAIR) &&
|
||||
($jo->hasSealant()))
|
||||
$criteria->setHasSealant(true);
|
||||
|
||||
// set if taxable
|
||||
// NOTE: ideally, this should be a parameter when calling generateInvoiceCriteria. But that
|
||||
// would mean adding it as a parameter to the call, impacting all calls
|
||||
|
|
|
|||
|
|
@ -1207,6 +1207,8 @@
|
|||
|
||||
<script>
|
||||
var invoiceItems = [];
|
||||
var hasCoolant = 0;
|
||||
var hasSealant = 0;
|
||||
|
||||
// location search autocomplete
|
||||
var input = document.getElementById('m_gmap_address');
|
||||
|
|
@ -1270,6 +1272,19 @@ $(function() {
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
// need to check if jo has coolant or sealant
|
||||
{% if obj.getServiceType == 'overheat' %}
|
||||
{% if obj.hasCoolant == 1 %}
|
||||
hasCoolant = 1;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if obj.getServiceType == 'tire' %}
|
||||
{% if obj.hasSealant == 1 %}
|
||||
hasSealant = 1;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
|
|
@ -1830,6 +1845,8 @@ $(function() {
|
|||
'cvid': cvid,
|
||||
'coord_lng': lng,
|
||||
'coord_lat': lat,
|
||||
'flag_coolant': hasCoolant,
|
||||
'flag_sealant': hasSealant,
|
||||
}
|
||||
}).done(function(response) {
|
||||
// mark as invoice changed
|
||||
|
|
|
|||
Loading…
Reference in a new issue