Apply missing warranty expiration fix to updates on customer form

This commit is contained in:
Ramon Gutierrez 2018-01-17 16:06:54 +08:00
parent 975f16647c
commit 53292697a2

View file

@ -445,10 +445,15 @@ class CustomerController extends BaseController
if (empty($bobj)) {
$verror_array[$vehicle->index]['battery'] = 'Invalid battery specified.';
} else {
// check if warranty expiration was specified
$warr_ex = DateTime::createFromFormat("d M Y", $vehicle->warranty_expiration);
if (!$warr_ex)
$warr_ex = null;
$cust_vehicle->setHasMotoliteBattery(true)
->setCurrentBattery($bobj)
->setWarrantyCode($vehicle->warranty_code)
->setWarrantyExpiration(DateTime::createFromFormat("d M Y", $vehicle->warranty_expiration));
->setWarrantyExpiration($warr_ex);
}
} else {
$cust_vehicle->setHasMotoliteBattery(false);