simplification cumul versements

FossilOrigin-Name: e4a942b3cc6913da11da2dfd480b2f71703c1781911e8d7c5e0a57c1b170bfd8
This commit is contained in:
engel 2022-03-25 15:09:55 +00:00
parent 83cc830fb1
commit b1645828fc
6 changed files with 44 additions and 84 deletions

View file

@ -61,22 +61,12 @@ foreach ($totalPersonnes as $idPersonne => $personne)
$articlesCGI,
$signature
);
// extraire les montants des versements
$lesMontants = array();
foreach ($personne->versements as $versement)
{
if (array_key_exists($versement->tauxReduction, $lesMontants)) {
$lesMontants[$versement->tauxReduction] += $versement->montant;
}
else {
$lesMontants[$versement->tauxReduction] = $versement->montant;
}
}
$html->imprimer_recu(
$_SESSION['annee_recu'],
$personne->id,
$personne->nomPrenom,
$lesMontants,
$personne->versements,
$personne->adresse,
$personne->codePostal,
$personne->ville
@ -117,12 +107,12 @@ function cumulerVersements($versements)
$ligne->idUser != $idPersonneCourant
)
{
if ($idTarifCourant != -1) {
if ($idTarifCourant != -1)
{
// changement de tarif ou de personne
$totalPersonnes[$idPersonneCourant]->ajouterVersement(
$_SESSION['lesTarifs'][$idTarifCourant]->idActivite,
$idTarifCourant,
$totalVersements/100,
$_SESSION['tauxSelectionnes'][$idTarifCourant]
$_SESSION['tauxSelectionnes'][$idTarifCourant],
$totalVersements/100
);
}
$idTarifCourant = $ligne->idTarif;
@ -140,10 +130,8 @@ function cumulerVersements($versements)
}
// et le dernier
$totalPersonnes[$idPersonneCourant]->ajouterVersement(
$_SESSION['lesTarifs'][$idTarifCourant]->idActivite,
$idTarifCourant,
$totalVersements/100,
$_SESSION['tauxSelectionnes'][$idTarifCourant]
$_SESSION['tauxSelectionnes'][$idTarifCourant],
$totalVersements/100
);
return $totalPersonnes;
}