Fix triggered error

This commit is contained in:
Laurent Destailleur 2017-05-04 15:52:12 +02:00
parent 01188e4bc0
commit ea58fb0b50

View File

@ -2669,21 +2669,22 @@ class CommandeFournisseur extends CommonOrder
$sql.= " FROM ".MAIN_DB_PREFIX.'c_input_method'; $sql.= " FROM ".MAIN_DB_PREFIX.'c_input_method';
$sql.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id); $sql.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id);
$query = $db->query($sql); $resql = $db->query($sql);
if ($query && $db->num_rows($query)) if ($resql)
{ {
$obj = $db->fetch_object($query); if ($db->num_rows($query))
$string = $langs->trans($obj->code);
if ($string == $obj->code)
{ {
$string = $obj->label != '-' ? $obj->label : ''; $obj = $db->fetch_object($query);
}
$string = $langs->trans($obj->code);
return $string; if ($string == $obj->code)
{
$string = $obj->label != '-' ? $obj->label : '';
}
return $string;
}
} }
else dol_print_error($db);
dol_print_error($db);
} }
return ''; return '';