Return the customer and customer vehicle saving #274

This commit is contained in:
Kendrick Chan 2019-11-21 09:18:31 +08:00
parent 575bf21639
commit 9a4ead6ab9

View file

@ -175,6 +175,7 @@ class CreateCustomerFromWarrantyCommand extends Command
// if there was a customer vehicle matched
if ($cv_found)
{
// vehicle found, do nothing.
error_log('vehicle found - ' . $w_plate_number);
}
else
@ -182,10 +183,8 @@ class CreateCustomerFromWarrantyCommand extends Command
// customer exists but not customer vehicle
// add customer vehicle to existing customer with unknown manufacturer and make
error_log('new vehicle - ' . $w_plate_number);
/*
$this->createCustomerVehicle($customer, $default_vehicle, $w_plate_number);
$total_cv_added++;
*/
}
}
}
@ -193,7 +192,6 @@ class CreateCustomerFromWarrantyCommand extends Command
else
{
error_log('NEW customer and vehicle - ' . $w_plate_number);
/*
// customer not found, add customer and customer vehicle
// get warranty first name, last name
$w_first_name = $warr->getFirstName();
@ -209,7 +207,6 @@ class CreateCustomerFromWarrantyCommand extends Command
->setPhoneMobile($w_mobile_num);
$this->em->persist($new_cust);
$this->em->flush();
$this->createCustomerVehicle($new_cust, $default_vehicle, $w_plate_number);
@ -218,9 +215,9 @@ class CreateCustomerFromWarrantyCommand extends Command
$total_cust_added++;
$total_cv_added++;
*/
}
}
$this->em->flush();
$this->em->clear();
}
@ -326,7 +323,6 @@ class CreateCustomerFromWarrantyCommand extends Command
->setVehicle($vehicle);
$this->em->persist($new_cv);
$this->em->flush();
}
protected function processInvalidEntries($warr)