diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 35b52243804..3842a8cd2a9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -940,7 +940,7 @@ class Societe extends CommonObject if ($this->client) { $rescode = $this->check_codeclient(); - if ($rescode <> 0) + if ($rescode != 0 && $rescode != -5) { if ($rescode == -1) { @@ -965,7 +965,7 @@ class Societe extends CommonObject if ($this->fournisseur) { $rescode = $this->check_codefournisseur(); - if ($rescode <> 0) + if ($rescode != 0 && $rescode != -5) { if ($rescode == -1) { @@ -979,7 +979,7 @@ class Societe extends CommonObject { $this->errors[] = 'ErrorSupplierCodeAlreadyUsed'; } - elseif ($rescode == -5) + elseif ($rescode == -4) { $this->errors[] = 'ErrorPrefixRequired'; } @@ -3057,6 +3057,8 @@ class Societe extends CommonObject * -2 ErrorCustomerCodeRequired * -3 ErrorCustomerCodeAlreadyUsed * -4 ErrorPrefixRequired + * -5 NotConfigured - Setup empty so any value may be ok or not + * -6 Other (see this->error) */ public function check_codefournisseur() {