Add saving of serial when adding/editing/fulfilling a JO. #335
This commit is contained in:
parent
cf7e026948
commit
9cd5915e88
4 changed files with 20 additions and 7 deletions
|
|
@ -909,7 +909,7 @@ class JobOrderController extends Controller
|
||||||
$this->denyAccessUnlessGranted('jo_onestep.edit', null, 'No access.');
|
$this->denyAccessUnlessGranted('jo_onestep.edit', null, 'No access.');
|
||||||
|
|
||||||
$error_array = [];
|
$error_array = [];
|
||||||
$error_array = $jo_handler->generateOneStepJobOrder($req, $id);
|
$error_array = $jo_handler->processOneStepJobOrder($req, $id);
|
||||||
|
|
||||||
// check if any errors were found
|
// check if any errors were found
|
||||||
if (!empty($error_array)) {
|
if (!empty($error_array)) {
|
||||||
|
|
|
||||||
|
|
@ -444,7 +444,8 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setColor('')
|
->setColor('')
|
||||||
->setStatusCondition('')
|
->setStatusCondition('')
|
||||||
->setFuelType('')
|
->setFuelType('')
|
||||||
->setActive();
|
->setActive()
|
||||||
|
->setWarrantyCode($req->request->get('warranty_code'));
|
||||||
|
|
||||||
if (($req->request->get('service_type')) == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
if (($req->request->get('service_type')) == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
{
|
{
|
||||||
|
|
@ -480,6 +481,11 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
{
|
{
|
||||||
$jo->setCustomerVehicle($cust_vehicle);
|
$jo->setCustomerVehicle($cust_vehicle);
|
||||||
$jo->setCustomer($cust_vehicle->getCustomer());
|
$jo->setCustomer($cust_vehicle->getCustomer());
|
||||||
|
|
||||||
|
// save serial into cv
|
||||||
|
$cust_vehicle->setWarrantyCode($req->request->get('warranty_code'));
|
||||||
|
|
||||||
|
$em->persist($cust_vehicle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -893,8 +899,11 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
// save to customer vehicle battery record
|
// save to customer vehicle battery record
|
||||||
$this->updateVehicleBattery($obj);
|
$this->updateVehicleBattery($obj);
|
||||||
|
|
||||||
// validated! save the entity
|
// save serial to customer vehicle
|
||||||
$em->flush();
|
$cust_vehicle = $obj->getCustomerVehicle();
|
||||||
|
$cust_vehicle->setWarrantyCode($req->request->get('warranty_code'));
|
||||||
|
|
||||||
|
$em->persist($cust_vehicle);
|
||||||
|
|
||||||
// get rider
|
// get rider
|
||||||
$rider = $obj->getRider();
|
$rider = $obj->getRider();
|
||||||
|
|
@ -909,7 +918,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
// create the warranty if new battery only
|
// create the warranty if new battery only
|
||||||
if ($obj->getServiceType () == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
if ($obj->getServiceType () == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
{
|
{
|
||||||
$serial = null;
|
$serial = $req->request->get('warranty_code') ;
|
||||||
$warranty_class = $obj->getWarrantyClass();
|
$warranty_class = $obj->getWarrantyClass();
|
||||||
$first_name = $obj->getCustomer()->getFirstName();
|
$first_name = $obj->getCustomer()->getFirstName();
|
||||||
$last_name = $obj->getCustomer()->getLastName();
|
$last_name = $obj->getCustomer()->getLastName();
|
||||||
|
|
@ -945,6 +954,9 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$this->wh->createWarranty($serial, $plate_number, $first_name, $last_name, $mobile_number, $batt_list, $date_purchase, $warranty_class);
|
$this->wh->createWarranty($serial, $plate_number, $first_name, $last_name, $mobile_number, $batt_list, $date_purchase, $warranty_class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// validated! save the entity
|
||||||
|
$em->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2301,6 +2313,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
|
|
||||||
// warranty expiration
|
// warranty expiration
|
||||||
// use GetWarrantyPrivate for passenger warranty
|
// use GetWarrantyPrivate for passenger warranty
|
||||||
|
$warr_months = 0;
|
||||||
$warr = $jo->getWarrantyClass();
|
$warr = $jo->getWarrantyClass();
|
||||||
if ($warr == CMBWarrantyClass::WTY_PASSENGER)
|
if ($warr == CMBWarrantyClass::WTY_PASSENGER)
|
||||||
$warr_months = $battery->getWarrantyPrivate();
|
$warr_months = $battery->getWarrantyPrivate();
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
// create warranty
|
// create warranty
|
||||||
if ($jo->getServiceType() == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
if ($jo->getServiceType() == CMBServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
{
|
{
|
||||||
$serial = null;
|
$serial = $jo->getCustomerVehicle()->getWarrantyCode();
|
||||||
$warranty_class = $jo->getWarrantyClass();
|
$warranty_class = $jo->getWarrantyClass();
|
||||||
$first_name = $jo->getCustomer()->getFirstName();
|
$first_name = $jo->getCustomer()->getFirstName();
|
||||||
$last_name = $jo->getCustomer()->getLastName();
|
$last_name = $jo->getCustomer()->getLastName();
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3">
|
<div class="col-lg-3">
|
||||||
<label data-field="warranty_code">Serial Number</label>
|
<label data-field="warranty_code">Serial Number</label>
|
||||||
<input type="text" name="warranty_code" id="warranty-code" class="form-control m-input" value="{{ obj.getCustomerVehicle ? obj.getCustomerVehicle.getWarrantyCode }}" data-vehicle-field="1" disabled>
|
<input type="text" name="warranty_code" id="warranty-code" class="form-control m-input" value="{{ obj.getCustomerVehicle ? obj.getCustomerVehicle.getWarrantyCode }}">
|
||||||
<div class="form-control-feedback hide" data-field="warranty_code"></div>
|
<div class="form-control-feedback hide" data-field="warranty_code"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3">
|
<div class="col-lg-3">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue