From c7f66d3cc43919528a12e67df281ae78f6014099 Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:16:41 +0100 Subject: [PATCH 1/2] Fix non exist column in Facture Stats --- htdocs/compta/facture/class/facturestats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index e6d8b689ac2b7..f3b742f87ade3 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -136,7 +136,7 @@ public function __construct(DoliDB $db, $socid, $mode, $userid = 0, $typentid = } if ($categid) { - $this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; + $this->where .= ' AND EXISTS (SELECT fk_categorie FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } } From ee7d5f8a760cff37889a71d828146dfcd5326192 Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:51:31 +0100 Subject: [PATCH 2/2] Update facturestats.class.php --- htdocs/compta/facture/class/facturestats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index f3b742f87ade3..4d69db45350c5 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -136,7 +136,7 @@ public function __construct(DoliDB $db, $socid, $mode, $userid = 0, $typentid = } if ($categid) { - $this->where .= ' AND EXISTS (SELECT fk_categorie FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; + $this->where .= ' AND EXISTS (SELECT cats.fk_categorie FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } }