bbfba688c6
FossilOrigin-Name: c4ee1e2f9ebe9c1a99adb825034569a4274d92e953df1a30475210c08bc3aa28
70 lines
1.5 KiB
PHP
70 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Garradin\Plugin\RecusFiscaux;
|
|
|
|
/**
|
|
* rassembler les infos d'une personne
|
|
*/
|
|
class Personne
|
|
{
|
|
public $id;
|
|
public $rang; // par ordre alpha de nomPrenom ; sert aux tris
|
|
public $nomPrenom;
|
|
public $adresse;
|
|
public $codePostal;
|
|
public $ville;
|
|
public $versements; // versements par taux de réduction
|
|
|
|
public function __construct(
|
|
$id,
|
|
$rang,
|
|
$nomPrenom,
|
|
$adresse,
|
|
$codePostal,
|
|
$ville
|
|
)
|
|
{
|
|
$this->id = $id;
|
|
$this->rang = $rang;
|
|
$this->nomPrenom = $nomPrenom;
|
|
$this->adresse = $adresse;
|
|
$this->codePostal = $codePostal;
|
|
$this->ville = $ville;
|
|
$this->versements = array(); // clé = tarif, valeur = montant
|
|
}
|
|
|
|
/**
|
|
* return copie d'une personne
|
|
*/
|
|
public function clone()
|
|
{
|
|
return new Personne(
|
|
$this->id,
|
|
$this->rang,
|
|
$this->nomPrenom,
|
|
$this->adresse,
|
|
$this->codePostal,
|
|
$this->ville);
|
|
}
|
|
|
|
/**
|
|
* ajouter un versement
|
|
* @param $tauxReduction
|
|
* @param $montant
|
|
*/
|
|
public function ajouterVersement(
|
|
$tauxReduction,
|
|
$montant
|
|
)
|
|
{
|
|
if (array_key_exists($tauxReduction, $this->versements))
|
|
{
|
|
$this->versements[$tauxReduction] += $montant;
|
|
}
|
|
else
|
|
{
|
|
$this->versements[$tauxReduction] = $montant;
|
|
}
|
|
}
|
|
}
|