FIX Creation of thirdparty when setup is empty

This commit is contained in:
Laurent Destailleur 2020-12-29 04:30:37 +01:00
parent d2af03856c
commit c3326a0963

View File

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