Merge pull request #25980 from atm-maxime/new_idprofcheck_be

NEW : add IdProfCheck on thirdparty for BE (xxxx.xxx.xxx)
This commit is contained in:
Laurent Destailleur 2023-09-21 19:33:05 +02:00 committed by GitHub
commit 2aea4ff29f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3996,6 +3996,20 @@ class Societe extends CommonObject
}
}
//Verify ID Prof 1 if country is BE (xxxx.xxx.xxx) (https://economie.fgov.be/fr/themes/entreprises/banque-carrefour-des/actualites/structure-du-numero)
//Returns: 1 if ok, -1 if bad, 0 if unexpected bad
if ($idprof == 1 && $soc->country_code == 'BE') {
$string = trim($this->idprof1);
$string = preg_replace('/(\s)/', '', $string);
//Check
if (preg_match('/(^[0-9]{4}\.[0-9]{3}\.[0-9]{3}$)/', $string)) {
return 1;
} else {
return -1;
}
}
return $ok;
}