diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index cfaf6932b73..da9769d748a 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -427,19 +427,20 @@ if (empty($reshook))
if (! empty($object->email) && ! isValidEMail($object->email))
{
$langs->load("errors");
- $error++; $errors[] = $langs->trans("ErrorBadEMail",$object->email);
+ $error++;
+ setEventMessages('', $langs->trans("ErrorBadEMail",$object->email), 'errors');
$action = ($action=='add'?'create':'edit');
}
if (! empty($object->url) && ! isValidUrl($object->url))
{
$langs->load("errors");
- $error++; $errors[] = $langs->trans("ErrorBadUrl",$object->url);
+ setEventMessages('', $langs->trans("ErrorBadUrl",$object->url), 'errors');
$action = ($action=='add'?'create':'edit');
}
if ($object->fournisseur && ! $conf->fournisseur->enabled)
{
$langs->load("errors");
- $error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled");
+ setEventMessages('', $langs->trans("ErrorSupplierModuleNotEnabled"), 'errors');
$action = ($action=='add'?'create':'edit');
}
if (! empty($object->webservices_url)) {
@@ -482,9 +483,10 @@ if (empty($reshook))
{
dol_syslog("We ask to create a contact/address too", LOG_DEBUG);
$result=$object->create_individual($user);
- if (! $result >= 0)
+ if ($result < 0)
{
- $error=$object->error; $errors=$object->errors;
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
}
}
@@ -546,7 +548,8 @@ if (empty($reshook))
$object->code_client = null;
}
- $error=$object->error; $errors=$object->errors;
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
}
if ($result >= 0)
@@ -600,7 +603,8 @@ if (empty($reshook))
$result = $object->update($socid, $user, 1, $object->oldcopy->codeclient_modifiable(), $object->oldcopy->codefournisseur_modifiable(), 'update', 0);
if ($result <= 0)
{
- $error = $object->error; $errors = $object->errors;
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
}
// Customer categories association
@@ -722,7 +726,8 @@ if (empty($reshook))
else
{
$langs->load("errors");
- $error=$langs->trans($object->error); $errors = $object->errors;
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
$action='';
}
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 5360350c75c..e9ec77f6d1b 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1966,7 +1966,11 @@ class Societe extends CommonObject
$label.= '
' . $langs->trans('Name') . ': '. $this->name;
if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')';
}
- if (! empty($this->code_client) && $this->client)
+ if (! empty($this->country_code))
+ $label.= '
' . $langs->trans('Country') . ': '. $this->country_code;
+ if (! empty($this->tva_intra))
+ $label.= '
' . $langs->trans('VATNumber') . ': '. $this->tva_intra;
+ if (! empty($this->code_client) && $this->client)
$label.= '
' . $langs->trans('CustomerCode') . ': '. $this->code_client;
if (! empty($this->code_fournisseur) && $this->fournisseur)
$label.= '
' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur;