diff --git a/src/Controller/CustomerController.php b/src/Controller/CustomerController.php index be0bc6c9..81bdfe76 100644 --- a/src/Controller/CustomerController.php +++ b/src/Controller/CustomerController.php @@ -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);