Fix issue of sealant and coolant fee not displaying in open edit form. #811

This commit is contained in:
Korina Cordero 2024-12-05 01:48:39 -05:00
parent 1b24e68f6b
commit dedfb58a28
3 changed files with 30 additions and 1 deletions

View file

@ -754,6 +754,8 @@ class JobOrderController extends Controller
$promo_id = $req->request->get('promo'); $promo_id = $req->request->get('promo');
$cvid = $req->request->get('cvid'); $cvid = $req->request->get('cvid');
$service_charges = $req->request->get('service_charges', []); $service_charges = $req->request->get('service_charges', []);
$flag_coolant = $req->request->get('flag_coolant', false);
$flag_sealant = $req->request->get('flag_sealant', false);
// coordinates // coordinates
// need to check if lng and lat are set // need to check if lng and lat are set
@ -784,7 +786,9 @@ class JobOrderController extends Controller
->setCustomerVehicle($cv) ->setCustomerVehicle($cv)
->setIsTaxable() ->setIsTaxable()
->setSource(TransactionOrigin::CALL) ->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 // if it's a jumpstart or troubleshoot only, we know what to charge already

View file

@ -69,6 +69,14 @@ class InvoiceManager implements InvoiceGeneratorInterface
->setCustomerVehicle($jo->getCustomerVehicle()) ->setCustomerVehicle($jo->getCustomerVehicle())
->setPriceTier($price_tier); ->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 // set if taxable
// NOTE: ideally, this should be a parameter when calling generateInvoiceCriteria. But that // 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 // would mean adding it as a parameter to the call, impacting all calls

View file

@ -1207,6 +1207,8 @@
<script> <script>
var invoiceItems = []; var invoiceItems = [];
var hasCoolant = 0;
var hasSealant = 0;
// location search autocomplete // location search autocomplete
var input = document.getElementById('m_gmap_address'); var input = document.getElementById('m_gmap_address');
@ -1270,6 +1272,19 @@ $(function() {
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% 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 %} {% endif %}
} }
@ -1830,6 +1845,8 @@ $(function() {
'cvid': cvid, 'cvid': cvid,
'coord_lng': lng, 'coord_lng': lng,
'coord_lat': lat, 'coord_lat': lat,
'flag_coolant': hasCoolant,
'flag_sealant': hasSealant,
} }
}).done(function(response) { }).done(function(response) {
// mark as invoice changed // mark as invoice changed