Merge branch 'fix_preprod_erp' into dev

This commit is contained in:
Rodney Figaro 2017-03-29 09:05:54 +02:00
commit 9426808c2e
2 changed files with 16 additions and 0 deletions

View File

@ -73,6 +73,14 @@ foreach ($ids_customer as $id_customer) {
continue;
}
}
if (defined('ERP_PREPROD') && ERP_PREPROD) {
if (preg_match('/@roykin.fr$/', $email)!==1 ||
preg_match('/@antadis.com$/', $email)!==1) {
$email = 'roykin+'.md5($email).'@antadis.com';
}
}
// ppp($id_customer.' loop');
// var_dump(ErpTools::alreadyExists($record['id']));
// var_dump(Customer::getCustomersByEmail($email));

View File

@ -71,6 +71,14 @@ foreach ($ids_customer_update as $id_customer) {
}
}
if (defined('ERP_PREPROD') && ERP_PREPROD) {
if (preg_match('/@roykin.fr$/', $email)!==1 ||
preg_match('/@antadis.com$/', $email)!==1) {
$email = 'roykin+'.md5($email).'@antadis.com';
}
}
// 12611 - get rid of unwanted characters in phone number (eg "01 02 03 04 05 (PIERRE)" found in ERP)
if (isset($record['phone']) && !empty($record['phone'])) {
$record['phone'] = preg_replace('/[^\+0-9\. \(\)\-]+/', '', $record['phone']);