From 358aad1ec79984200cfb08ba6b01de1662f279fe Mon Sep 17 00:00:00 2001 From: engel <> Date: Wed, 18 May 2022 19:38:59 +0000 Subject: [PATCH] correction bug total compte FossilOrigin-Name: d24bebd61e6729bab7cb2caa65523d20146e187b621935e47be84169db710dc7 --- www/admin/generer_recus.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/www/admin/generer_recus.php b/www/admin/generer_recus.php index 8f17c1b..760fd0b 100644 --- a/www/admin/generer_recus.php +++ b/www/admin/generer_recus.php @@ -205,25 +205,31 @@ function cumulerVersementsTarif($versements) $totalPersonnes = array(); $idTarifCourant = -1; $idPersonneCourant = -1; + $idCompteCourant = -1; $totalVersements = 0; foreach ($versements as $ligne) { if ( - $ligne->idTarif != $idTarifCourant || - $ligne->idUser != $idPersonneCourant + $ligne->idTarif != $idTarifCourant || + $ligne->idUser != $idPersonneCourant || + $ligne->idCompte != $idCompteCourant ) { if ($idTarifCourant != -1) { // changement de tarif ou de personne + $tarifCompte = ($idTarifCourant == 0) ? + $idCompteCourant : + $idTarifCourant . "_" . $idCompteCourant; $totalPersonnes[$idPersonneCourant]->ajouterVersement( - $_SESSION['tauxSelectionnes'][$idTarifCourant], + $_SESSION['tauxSelectionnes'][$tarifCompte], $totalVersements ); } - $idTarifCourant = $ligne->idTarif; + $idTarifCourant = $ligne->idTarif; $idPersonneCourant = $ligne->idUser; - $totalVersements = $ligne->versement; + $idCompteCourant = $ligne->idCompte; + $totalVersements = $ligne->versement; // créer les infos de la personne, sauf si elle est déjà présente if (!array_key_exists($idPersonneCourant, $totalPersonnes)) { @@ -235,8 +241,11 @@ function cumulerVersementsTarif($versements) } } // et le dernier + $tarifCompte = ($idTarifCourant == 0) ? + $idCompteCourant : + $idTarifCourant . "_" . $idCompteCourant; $totalPersonnes[$idPersonneCourant]->ajouterVersement( - $_SESSION['tauxSelectionnes'][$idTarifCourant], + $_SESSION['tauxSelectionnes'][$tarifCompte], $totalVersements ); return $totalPersonnes;