2
0
forked from Wavyzz/dolibarr

Fix check on VAT syntax not visible on list

This commit is contained in:
Laurent Destailleur
2019-05-22 15:37:59 +02:00
parent 18f1952e2d
commit 11bcfb4f5e
3 changed files with 15 additions and 5 deletions

View File

@@ -568,7 +568,7 @@ function isValidUrl($url, $http = 0, $pass = 0, $port = 0, $path = 0, $query = 0
* Check if VAT numero is valid (check done on syntax only, no database or remote access)
*
* @param Societe $company VAT number
* @return int 1=Check is OK, 0=Check is KO
* @return int 1=Check is OK, 0=Check is KO
*/
function isValidVATID($company)
{
@@ -577,7 +577,7 @@ function isValidVATID($company)
$vatprefix = $company->country_code;
if ($vatprefix == 'GR') $vatprefix = '(EL|GR)';
else $vatprefix = preg_quote($vatprefix, '/');
if (! preg_match('/^'.$vatprefix.'[a-zA-Z0-9\-\.]{5,12}$/', $company->tva_intra))
if (! preg_match('/^'.$vatprefix.'[a-zA-Z0-9\-\.\s]{5,12}$/', $company->tva_intra))
{
return 0;
}