From d9ac21ab822ede55f6090c86c40eb85da1bfa2a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?=
 <marcosgdf@gmail.com>
Date: Sun, 8 Feb 2015 16:54:41 +0100
Subject: [PATCH] Fix: [ bug #1822 ] SQL error in clientfourn.php report with
 PostgreSQL

---
 ChangeLog                              | 1 +
 htdocs/compta/resultat/clientfourn.php | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 5870e55152d..349ac323ff9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@ English Dolibarr ChangeLog
 - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase
 - Fix: [ bug #1819 ] SQL error when searching for an invoice payment
 - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes
+- Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL
 
 ***** ChangeLog for 3.6.2 compared to 3.6.1 *****
 - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 26589be3c5d..1e09ea0a8fe 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -551,7 +551,7 @@ $sql.= " WHERE p.entity = ".$conf->entity;
 if (! empty($date_start) && ! empty($date_end))
 	$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
 	
-$sql.= " GROUP BY u.rowid";
+$sql.= " GROUP BY u.rowid, p.label, p.datep, p.fk_user";
 $sql.= " ORDER BY u.firstname";
     
 dol_syslog("get payment salaries sql=".$sql);
-- 
GitLab