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.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id);
$query = $db->query($sql);
if ($query && $db->num_rows($query))
$resql = $db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($query);
$string = $langs->trans($obj->code);
if ($string == $obj->code)
if ($db->num_rows($query))
{
$string = $obj->label != '-' ? $obj->label : '';
}
return $string;
$obj = $db->fetch_object($query);
$string = $langs->trans($obj->code);
if ($string == $obj->code)
{
$string = $obj->label != '-' ? $obj->label : '';
}
return $string;
}
}
dol_print_error($db);
else dol_print_error($db);
}
return '';