From 8eebf6ee1ccd87c1ef837771ff965ac17cc1e7b0 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Fri, 4 Sep 2020 08:07:31 +0000 Subject: [PATCH] Add invalid mobile numbers to invalid file. #460 --- src/Command/MigrateCMBLegacyJobOrderCommand.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Command/MigrateCMBLegacyJobOrderCommand.php b/src/Command/MigrateCMBLegacyJobOrderCommand.php index 3b09b6e8..2b42ddd0 100644 --- a/src/Command/MigrateCMBLegacyJobOrderCommand.php +++ b/src/Command/MigrateCMBLegacyJobOrderCommand.php @@ -180,6 +180,21 @@ class MigrateCMBLegacyJobOrderCommand extends Command continue; } + // check if mobile phone number has letters or spaces or special characters + if (!(preg_match('/^\d+$/', $customer_mobile))) + { + // not a valid mobile number + //error_log('invalid number ' . $customer_mobile); + $invalid_entries[] = $this->addInvalidEntry($entry_num, $date_create, $case_number, $insurer, $plate_number, $car_model, + $nature_of_call, $service_needed, $location, $state, $driver, $truck, $workshop_arrival_time, + $status, $customer_name, $customer_mobile, $reference, $odometer, $batt_model, $batt_size, + $batt_trade_in, $replaced_by, $remark, $satisfaction, 'Invalid mobile number'); + + $total_inv_entries++; + // move to next entry + continue; + } + // create job order $cmb_legacy_jo = new CMBLegacyJobOrder();