From f95475ea237eccb150a10eb3e248fef029796f4c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Mar 2005 23:12:55 +0000 Subject: [PATCH] Fix: Correction group by incomplet --- htdocs/compta/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index a3e44fea630..bbfe8ce70b8 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -101,7 +101,9 @@ print "
"; if ($conf->facture->enabled) { - $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; + $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + $sql .= " WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; if ($socidp) { @@ -291,7 +293,7 @@ if ($conf->facture->enabled) { $sql .= " AND f.fk_soc = $socidp"; } - $sql .= " GROUP BY f.facnumber,f.rowid,s.nom, s.idp, f.total_ttc"; + $sql .= " GROUP BY f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc"; if ( $db->query($sql) ) {