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.
This commit is contained in:
rogue-spectre
2025-03-31 11:43:18 +02:00
committed by GitHub
parent 3eab9d56c7
commit d74383afce

View File

@@ -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";