Resolve "Command to create customer from existing warranties" #1132

Merged
korina.cordero merged 15 commits from 274-create-customer-from-existing-warranties into master 2019-11-21 05:22:45 +00:00
Showing only changes of commit 2b21db6c01 - Show all commits

View file

@ -130,12 +130,26 @@ class CreateCustomerFromWarrantyCommand extends Command
if (empty($w_mobile_num))
continue;
// does it fit our 09XXXXXXXXX pattern?
if (preg_match('/^09[0-9]{9}$/', $w_mobile_num))
{
// remove first '0'
$w_mobile_num = substr($w_mobile_num, 1);
error_log("CONVERTED TO $w_mobile_num");
}
// does it fit our 9XXXXXXXXX pattern?
if (!preg_match('/^9[0-9]{9}$/', $w_mobile_num))
continue;
/*
// min length 2
// TODO: we need to check proper phone number format
// format should be '9XXXXXXXXX'
// TODO: if format doesn't fit and there's a 0 or 63 prefix, we should be able to detect and convert
if (strlen($w_mobile_num <= 2))
continue;
*/
error_log('');
error_log("($total_warr) processing $w_mobile_num from warranty...");