diff --git a/htdocs/includes/modules/societe/modules_societe.class.php b/htdocs/includes/modules/societe/modules_societe.class.php
index 67f278c4d12..928a03c0215 100644
--- a/htdocs/includes/modules/societe/modules_societe.class.php
+++ b/htdocs/includes/modules/societe/modules_societe.class.php
@@ -134,9 +134,11 @@ class ModeleThirdPartyCode
*/
function getToolTip($langs,$soc,$type)
{
+ $langs->load("admin");
+
$s='';
- $s.=$langs->trans("Name").': '.$this->nom.'
';
- $s.=$langs->trans("Version").': '.$this->getVersion().'
';
+ if ($type == -1) $s.=$langs->trans("Name").': '.$this->nom.'
';
+ if ($type == -1) $s.=$langs->trans("Version").': '.$this->getVersion().'
';
if ($type == 0) $s.=$langs->trans("CustomerCodeDesc").'
';
if ($type == 1) $s.=$langs->trans("SupplierCodeDesc").'
';
if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': '.$this->getNom($langs).'
';
@@ -149,8 +151,18 @@ class ModeleThirdPartyCode
$s.=$langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide,1,2).'
';
$s.=$langs->trans("AutomaticCode").': '.yn($this->code_auto,1,2).'
';
$s.='
';
- if ($type == 0 || $type == -1) $s.=$langs->trans("NextValue").' ('.$langs->trans("Customer").') : '.$this->getNextValue($soc,0).'
';
- if ($type == 1 || $type == -1) $s.=$langs->trans("NextValue").' ('.$langs->trans("Supplier").') : '.$this->getNextValue($soc,1).'';
+ if ($type == 0 || $type == -1)
+ {
+ $nextval=$this->getNextValue($soc,0);
+ if (empty($nextval)) $nextval=$langs->trans("Undefined");
+ $s.=$langs->trans("NextValue").($type == -1?' ('.$langs->trans("Customer").')':'').': '.$nextval.'
';
+ }
+ if ($type == 1 || $type == -1)
+ {
+ $nextval=$this->getNextValue($soc,1);
+ if (empty($nextval)) $nextval=$langs->trans("Undefined");
+ $s.=$langs->trans("NextValue").($type == -1?' ('.$langs->trans("Supplier").')':'').': '.$nextval.'';
+ }
return $s;
}