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:
commit
2aea4ff29f
1 changed files with 14 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue