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

@ -13,7 +13,7 @@ class Personne
public $codePostal;
public $ville;
public $courriel;
public $versements; // tableau des versements totaux par activité/tarif
public $versements; // versements par taux de réduction
public function __construct(
$id,
@ -30,7 +30,7 @@ class Personne
$this->codePostal = $codePostal;
$this->ville = $ville;
$this->courriel = $courriel;
$this->versements = array();
$this->versements = array(); // clé = tarif, valeur = montant
}
/**
@ -49,24 +49,21 @@ class Personne
/**
* ajouter un versement
* @param $idActivite
* @param $idTarif
* @param $montant
* @param $tauxReduction
* @param $montant
*/
public function ajouterVersement(
$idActivite,
$idTarif,
$montant,
$tauxReduction
$tauxReduction,
$montant
)
{
$this->versements[] =
new Versement(
$idActivite,
$idTarif,
$montant,
$tauxReduction
);
if (array_key_exists($tauxReduction, $this->versements))
{
$this->versements[$tauxReduction] += $montant;
}
else
{
$this->versements[$tauxReduction] = $montant;
}
}
}