From 63a7b506b1991e4c8f4f03eb4770912d4f217706 Mon Sep 17 00:00:00 2001
From: Sergio Sanchis <sergiosanchis@hotmail.com>
Date: Fri, 14 Oct 2016 10:55:54 +0200
Subject: [PATCH] Fix: Error if exist extrafield

---
 htdocs/compta/facture/list.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 796b0730c89..ce2843837df 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -767,6 +767,11 @@ if (! $sall)
     $sql.= ' f.datec, f.tms,';
     $sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.code_client, s.client, typent.code';
     $sql.= ' ,state.code_departement, state.nom';
+
+    foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
+    {
+        $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
+    }
 }
 else
 {
-- 
GitLab