NEW Show country and vat number into company tooltip

This commit is contained in:
Laurent Destailleur 2017-09-03 20:49:36 +02:00
parent ead7810ee7
commit 14f41493bb
2 changed files with 18 additions and 9 deletions

View File

@ -427,19 +427,20 @@ if (empty($reshook))
if (! empty($object->email) && ! isValidEMail($object->email)) if (! empty($object->email) && ! isValidEMail($object->email))
{ {
$langs->load("errors"); $langs->load("errors");
$error++; $errors[] = $langs->trans("ErrorBadEMail",$object->email); $error++;
setEventMessages('', $langs->trans("ErrorBadEMail",$object->email), 'errors');
$action = ($action=='add'?'create':'edit'); $action = ($action=='add'?'create':'edit');
} }
if (! empty($object->url) && ! isValidUrl($object->url)) if (! empty($object->url) && ! isValidUrl($object->url))
{ {
$langs->load("errors"); $langs->load("errors");
$error++; $errors[] = $langs->trans("ErrorBadUrl",$object->url); setEventMessages('', $langs->trans("ErrorBadUrl",$object->url), 'errors');
$action = ($action=='add'?'create':'edit'); $action = ($action=='add'?'create':'edit');
} }
if ($object->fournisseur && ! $conf->fournisseur->enabled) if ($object->fournisseur && ! $conf->fournisseur->enabled)
{ {
$langs->load("errors"); $langs->load("errors");
$error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled"); setEventMessages('', $langs->trans("ErrorSupplierModuleNotEnabled"), 'errors');
$action = ($action=='add'?'create':'edit'); $action = ($action=='add'?'create':'edit');
} }
if (! empty($object->webservices_url)) { if (! empty($object->webservices_url)) {
@ -482,9 +483,10 @@ if (empty($reshook))
{ {
dol_syslog("We ask to create a contact/address too", LOG_DEBUG); dol_syslog("We ask to create a contact/address too", LOG_DEBUG);
$result=$object->create_individual($user); $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; $object->code_client = null;
} }
$error=$object->error; $errors=$object->errors; setEventMessages($object->error, $object->errors, 'errors');
$error++;
} }
if ($result >= 0) 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); $result = $object->update($socid, $user, 1, $object->oldcopy->codeclient_modifiable(), $object->oldcopy->codefournisseur_modifiable(), 'update', 0);
if ($result <= 0) if ($result <= 0)
{ {
$error = $object->error; $errors = $object->errors; setEventMessages($object->error, $object->errors, 'errors');
$error++;
} }
// Customer categories association // Customer categories association
@ -722,7 +726,8 @@ if (empty($reshook))
else else
{ {
$langs->load("errors"); $langs->load("errors");
$error=$langs->trans($object->error); $errors = $object->errors; setEventMessages($object->error, $object->errors, 'errors');
$error++;
$action=''; $action='';
} }
} }

View File

@ -1966,6 +1966,10 @@ class Societe extends CommonObject
$label.= '<br><b>' . $langs->trans('Name') . ':</b> '. $this->name; $label.= '<br><b>' . $langs->trans('Name') . ':</b> '. $this->name;
if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')'; if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')';
} }
if (! empty($this->country_code))
$label.= '<br><b>' . $langs->trans('Country') . ':</b> '. $this->country_code;
if (! empty($this->tva_intra))
$label.= '<br><b>' . $langs->trans('VATNumber') . ':</b> '. $this->tva_intra;
if (! empty($this->code_client) && $this->client) if (! empty($this->code_client) && $this->client)
$label.= '<br><b>' . $langs->trans('CustomerCode') . ':</b> '. $this->code_client; $label.= '<br><b>' . $langs->trans('CustomerCode') . ':</b> '. $this->code_client;
if (! empty($this->code_fournisseur) && $this->fournisseur) if (! empty($this->code_fournisseur) && $this->fournisseur)