From 53292697a204a609f85636d5506e47859b539db6 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 17 Jan 2018 16:06:54 +0800 Subject: [PATCH] Apply missing warranty expiration fix to updates on customer form --- src/Controller/CustomerController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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);