From df7218b6a47636b873e0ddcb33a37e66f7d5c4b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Oct 2020 12:39:14 +0100 Subject: [PATCH] Fix for multicompany --- htdocs/categories/class/categorie.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 086e14b27d0..d37bdfed04d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -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);