Merge pull request #6659 from altatof/fix_incoterm

FIX: dont get empty "Incoterms : - " string if no incoterm
This commit is contained in:
Laurent Destailleur 2017-04-11 11:08:17 +02:00 committed by GitHub
commit d4de81ed6d

View File

@ -3073,8 +3073,16 @@ abstract class CommonObject
$resql = $this->db->query($sql);
if ($resql)
{
$res = $this->db->fetch_object($resql);
return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
$num = $this->db->num_rows($resql);
if ($num > 0)
{
$res = $this->db->fetch_object($resql);
return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
}
else
{
return '';
}
}
else
{