Fix for multicompany

This commit is contained in:
Laurent Destailleur 2020-10-31 12:39:14 +01:00
parent b42361022d
commit df7218b6a4

View File

@ -1415,11 +1415,12 @@ class Categorie extends CommonObject
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type];
if ($type === Categorie::TYPE_BANK_LINE) { // TODO Remove this with standard category code
// Load bank groups
if ($type === Categorie::TYPE_BANK_LINE) { // TODO Remove this with standard category code after migration of llx_bank_categ into llx_categorie
// Load bank categories
$sql = "SELECT c.label, c.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
$sql .= " WHERE a.lineid=".$id." AND a.fk_categ = c.rowid";
$sql .= " AND c.entity IN (".getEntity('category').")";
$sql .= " ORDER BY c.label";
$res = $this->db->query($sql);