From c38b0c4dbec7414a21f94f8457aa3495b3d1261f Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 22 Feb 2019 12:17:34 +0100 Subject: [PATCH] FIX fk_default_warehouse missing in group by --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 761cce030f7..77fd4b1aa69 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -499,7 +499,7 @@ if ($id > 0 || ! empty($ref)) { $sql .= " WHERE l.fk_commande = " . $object->id; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql .= " AND l.product_type = 0"; - $sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product + $sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent, p.fk_default_warehouse"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product $sql .= " ORDER BY p.ref, p.label"; $resql = $db->query($sql);