From aa34f800c20ab639ba10dd845334d2f6f45d79e8 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 8 Sep 2023 11:18:59 +0200 Subject: [PATCH] user inner join --- htdocs/commande/class/commandestats.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 4a82edfd0c6..a339c87f569 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -246,8 +246,8 @@ class CommandeStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from; - $sql .= " LEFT JOIN ".$this->from_line." ON c.rowid = tl.fk_commande "; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as product ON tl.fk_product = product.rowid"; + $sql .= " INNER JOIN ".$this->from_line." ON c.rowid = tl.fk_commande "; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."product as product ON tl.fk_product = product.rowid"; if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); }