Apply missing warranty expiration fix to updates on customer form
This commit is contained in:
parent
975f16647c
commit
53292697a2
1 changed files with 6 additions and 1 deletions
|
|
@ -445,10 +445,15 @@ class CustomerController extends BaseController
|
||||||
if (empty($bobj)) {
|
if (empty($bobj)) {
|
||||||
$verror_array[$vehicle->index]['battery'] = 'Invalid battery specified.';
|
$verror_array[$vehicle->index]['battery'] = 'Invalid battery specified.';
|
||||||
} else {
|
} 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)
|
$cust_vehicle->setHasMotoliteBattery(true)
|
||||||
->setCurrentBattery($bobj)
|
->setCurrentBattery($bobj)
|
||||||
->setWarrantyCode($vehicle->warranty_code)
|
->setWarrantyCode($vehicle->warranty_code)
|
||||||
->setWarrantyExpiration(DateTime::createFromFormat("d M Y", $vehicle->warranty_expiration));
|
->setWarrantyExpiration($warr_ex);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$cust_vehicle->setHasMotoliteBattery(false);
|
$cust_vehicle->setHasMotoliteBattery(false);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue