Skip to content
Snippets Groups Projects
Commit d4de81ed authored by Laurent Destailleur's avatar Laurent Destailleur Committed by GitHub
Browse files

Merge pull request #6659 from altatof/fix_incoterm

FIX: dont get empty "Incoterms : - " string if no incoterm
parents e357aed3 d892a89f
Branches
Tags
No related merge requests found
...@@ -3072,11 +3072,19 @@ abstract class CommonObject ...@@ -3072,11 +3072,19 @@ abstract class CommonObject
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms; $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{
$num = $this->db->num_rows($resql);
if ($num > 0)
{ {
$res = $this->db->fetch_object($resql); $res = $this->db->fetch_object($resql);
return 'Incoterm : '.$res->code.' - '.$this->location_incoterms; return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
} }
else else
{
return '';
}
}
else
{ {
$this->errors[] = $this->db->lasterror(); $this->errors[] = $this->db->lasterror();
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment