From d74383afce7d24e4898610eb0c59ffcb32cf6a82 Mon Sep 17 00:00:00 2001 From: rogue-spectre Date: Mon, 31 Mar 2025 11:43:18 +0200 Subject: [PATCH] Update clientfourn.php (#33663) correction of a sql request returning a buggy result. Instead of the sum of the different donations payments the request returned the number of payment multiplied by the global amount of donation. --- htdocs/compta/resultat/clientfourn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index e42e7ad1a29..95274722834 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -569,7 +569,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql .= " WHERE p.entity IN (".getEntity('donation').")"; $sql .= " AND fk_statut in (1,2)"; } else { - $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(pe.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."don as p"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id";