83 lines
1.8 KiB
PHP
83 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Paheko\Plugin\RecusFiscaux;
|
|
|
|
/**
|
|
* rassembler les infos d'une personne
|
|
*/
|
|
class Personne
|
|
{
|
|
public $id;
|
|
public $numero;
|
|
public $courriel;
|
|
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,
|
|
$numero,
|
|
$courriel,
|
|
$rang,
|
|
$nomPrenom,
|
|
$adresse,
|
|
$codePostal,
|
|
$ville
|
|
)
|
|
{
|
|
$this->id = $id;
|
|
$this->numero = $numero;
|
|
$this->courriel = $courriel;
|
|
$this->rang = $rang;
|
|
$this->nomPrenom = $nomPrenom;
|
|
$this->adresse = $adresse;
|
|
$this->codePostal = $codePostal;
|
|
$this->ville = $ville;
|
|
$this->versements = array(); // clé = tarif, valeur = Versement
|
|
}
|
|
|
|
/**
|
|
* return copie d'une personne
|
|
*/
|
|
public function clone()
|
|
{
|
|
return new Personne(
|
|
$this->id,
|
|
$this->numero,
|
|
$this->courriel,
|
|
$this->rang,
|
|
$this->nomPrenom,
|
|
$this->adresse,
|
|
$this->codePostal,
|
|
$this->ville);
|
|
}
|
|
|
|
/**
|
|
* ajouter un versement
|
|
* @param $tauxReduction
|
|
* @param $montant
|
|
* @param $dateMin
|
|
* @param $dateMax
|
|
*/
|
|
public function ajouterVersement(
|
|
$tauxReduction,
|
|
$montant,
|
|
$dateMin,
|
|
$dateMax
|
|
)
|
|
{
|
|
if (array_key_exists($tauxReduction, $this->versements))
|
|
{
|
|
$this->versements[$tauxReduction]->ajouter($montant, $dateMin, $dateMax);
|
|
}
|
|
else
|
|
{
|
|
$this->versements[$tauxReduction] = new Versement($montant, $dateMin, $dateMax);
|
|
}
|
|
}
|
|
|
|
}
|