Skip to content
Snippets Groups Projects
Verified Commit e54b57b4 authored by Damien's avatar Damien
Browse files

FIX Imcomplete address

parent adacbb66
No related branches found
No related tags found
No related merge requests found
...@@ -563,7 +563,7 @@ class PreProcessActionController ...@@ -563,7 +563,7 @@ class PreProcessActionController
break; break;
} }
$afnorAddress = ContactController::getContactAfnor($contact[0]); $afnorAddress = ContactController::getContactAfnor($contact[0]);
if ((empty($afnorAddress[1]) && empty($afnorAddress[2])) || empty($afnorAddress[6])) { if ((empty($afnorAddress[1]) && empty($afnorAddress[2])) || empty($afnorAddress[6]) || !preg_match("/^\d{5}\s/", $afnorAddress[6])) {
$resInfo = ResModel::getExtById(['select' => ['alt_identifier'], 'resId' => $valueResId]); $resInfo = ResModel::getExtById(['select' => ['alt_identifier'], 'resId' => $valueResId]);
$canNotSend[] = ['resId' => $valueResId, 'chrono' => $resInfo['alt_identifier'], 'reason' => 'incompleteAddressForPostal', 'attachmentIdentifier' => $attachment['identifier']]; $canNotSend[] = ['resId' => $valueResId, 'chrono' => $resInfo['alt_identifier'], 'reason' => 'incompleteAddressForPostal', 'attachmentIdentifier' => $attachment['identifier']];
unset($aAttachments[$key]); unset($aAttachments[$key]);
......
...@@ -94,7 +94,7 @@ trait ShippingTrait ...@@ -94,7 +94,7 @@ trait ShippingTrait
return ['errors' => ['Contact country is not France']]; return ['errors' => ['Contact country is not France']];
} }
$afnorAddress = ContactController::getContactAfnor($contact[0]); $afnorAddress = ContactController::getContactAfnor($contact[0]);
if ((empty($afnorAddress[1]) && empty($afnorAddress[2])) || empty($afnorAddress[6])) { if ((empty($afnorAddress[1]) && empty($afnorAddress[2])) || empty($afnorAddress[6]) || !preg_match("/^\d{5}\s/", $afnorAddress[6])) {
return ['errors' => ['Contact is not fill enough for attachment']]; return ['errors' => ['Contact is not fill enough for attachment']];
} }
$contacts[] = $afnorAddress; $contacts[] = $afnorAddress;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment