From 161d0e4fdf72c666a8a481366d0c05e76a7afca1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Sep 2025 10:38:16 +0200 Subject: [PATCH] FIX missing entity filter (#35461) --- htdocs/core/boxes/box_graph_invoices_permonth.php | 2 +- htdocs/core/boxes/box_graph_invoices_peryear.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index af0dcbac277..9401154cefa 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -132,7 +132,7 @@ class box_graph_invoices_permonth extends ModeleBoxes $HEIGHT = '192'; $stats = new FactureStats($this->db, $socid, $mode, 0); - $stats->where = "f.fk_statut > 0"; + $stats->where = "f.entity IN (".getEntity('invoice').") AND f.fk_statut > 0"; $px1 = null; $px2 = null; diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index fccfa5b7530..b52fb20adfd 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -126,7 +126,7 @@ class box_graph_invoices_peryear extends ModeleBoxes $HEIGHT = '192'; $stats = new FactureStats($this->db, $socid, $mode, 0); - $stats->where = "f.fk_statut > 0"; + $stats->where = "f.entity IN (".getEntity('invoice').") AND f.fk_statut > 0"; // Build graphic amount of object. $data = array(array('Lib',val1,val2,val3),...) $data2 = $stats->getAmountByYear($numberyears);