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;