gestion complète taux réduction

FossilOrigin-Name: 65f4c90bd70dda1733695d52ff242e58fe10220efee4077c813f49961d2686bc
This commit is contained in:
engel 2022-02-18 11:51:13 +00:00
parent 38a3556dbd
commit 3acbd2038e
10 changed files with 61 additions and 28 deletions

View file

@ -41,8 +41,14 @@ foreach ($totalPersonnes as $idPersonne => $personne) {
);
// extraire les montants des versements
$lesMontants = array();
foreach ($personne->versements as $versement) {
$lesMontants[] = $versement->montant;
foreach ($personne->versements as $versement)
{
if (array_key_exists($versement->tauxReduction, $lesMontants)) {
$lesMontants[$versement->tauxReduction] += $versement->montant;
}
else {
$lesMontants[$versement->tauxReduction] = $versement->montant;
}
}
$pdf->imprimer_recu(
$_SESSION['annee_recu'],
@ -82,16 +88,19 @@ function cumulerVersements($versements)
$idTarif_courant = -1;
$idPersonne_courant = -1;
$totalVersements = 0;
foreach ($versements as $ligne) {
foreach ($versements as $ligne)
{
if (
$ligne->idTarif != $idTarif_courant ||
$ligne->idUser != $idPersonne_courant
) {
)
{
if ($idTarif_courant != -1) {
$totalPersonnes["$idPersonne_courant"]->ajouterVersement(
$totalPersonnes[$idPersonne_courant]->ajouterVersement(
$_SESSION['lesTarifs'][$idTarif_courant]->idActivite,
$idTarif_courant,
$totalVersements/100
$totalVersements/100,
$_SESSION['tauxSelectionnes'][$idTarif_courant]
);
}
$idTarif_courant = $ligne->idTarif;
@ -108,11 +117,12 @@ function cumulerVersements($versements)
}
}
// et le dernier
$totalPersonnes["$idPersonne_courant"]->ajouterVersement(
$_SESSION['lesTarifs'][$idTarif_courant]->idActivite,
$idTarif_courant,
$totalVersements/100
);
$totalPersonnes[$idPersonne_courant]->ajouterVersement(
$_SESSION['lesTarifs'][$idTarif_courant]->idActivite,
$idTarif_courant,
$totalVersements/100,
$_SESSION['tauxSelectionnes'][$idTarif_courant]
);
return $totalPersonnes;
}