Resolve "Additional validations for warranty upload" #1141

Merged
korina.cordero merged 3 commits from 288-additional-validations-for-warranty-upload into master 2020-01-20 02:36:04 +00:00
Showing only changes of commit bc74339fbf - Show all commits

View file

@ -531,6 +531,7 @@ class WarrantyController extends Controller
foreach($warr_results as $warr)
{
// check if details are complete
//error_log('Updating warranty with serial number ' . $serial . ' and plate number ' . $plate_number);
if (empty($warr->getFirstName()))
{
if (!empty($first_name))
@ -604,7 +605,16 @@ class WarrantyController extends Controller
}
else
{
// what if serial exists but plate number is different?
// TODO: what if serial exists but plate number is different?
// check if just the serial exists
// if warranty exists, ignore for now
$w_results = $em->getRepository(Warranty::class)->findBy(['serial' => $serial]);
if (!empty($w_results))
{
continue;
}
//error_log('Adding warranty with serial number ' . $serial . ' and plate number ' . $plate_number);
// new warranty
$warranty = new Warranty();