diff --git a/htdocs/compta/resultat/projects.php b/htdocs/compta/resultat/projects.php index fe078801fcfab..a5b433888a4db 100644 --- a/htdocs/compta/resultat/projects.php +++ b/htdocs/compta/resultat/projects.php @@ -694,7 +694,7 @@ $column = 'e.date_valid'; } else { - $sql = "SELECT ed.rowid as rowid, ed.fk_projet, p.rowid as project_rowid, p.ref as project_name, sum(pe.amount) as amount_ht, sum(pe.amount) as amount_ttc"; + $sql = "SELECT ed.rowid as rowid, ed.fk_projet, p.rowid as project_rowid, p.ref as project_name, sum(DISTINCT pe.amount) as amount_ht, sum(DISTINCT pe.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as ed"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport as e ON ed.fk_expensereport = e.rowid"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = e.rowid";