4eb8b7c61d
FossilOrigin-Name: 323bbe3ae892ca099aac2f897e592b35b7224c22ce25bd813e9a11dca0cf9f19
41 lines
795 B
PHP
41 lines
795 B
PHP
<?php
|
|
|
|
namespace Garradin\Plugin\RecusFiscaux;
|
|
|
|
class Versement
|
|
{
|
|
public $montant;
|
|
public $dateMin; // estampille
|
|
public $dateMax; // estampille
|
|
|
|
public function __construct(
|
|
$montant,
|
|
$dateMin,
|
|
$dateMax
|
|
)
|
|
{
|
|
$this->montant = $montant;
|
|
$this->dateMin = $dateMin;
|
|
$this->dateMax = $dateMax;
|
|
}
|
|
|
|
/**
|
|
* ajouter un versement en fixant les dates min et max
|
|
* @param $montant
|
|
* @param $dateMin
|
|
* @param $dateMax
|
|
*/
|
|
public function ajouter($montant, $dateMin, $dateMax)
|
|
{
|
|
$this->montant += $montant;
|
|
if ($dateMin < $this->dateMin)
|
|
{
|
|
$this->dateMin = $dateMin;
|
|
}
|
|
if ($dateMax > $this->dateMax)
|
|
{
|
|
$this->dateMax = $dateMax;
|
|
}
|
|
}
|
|
}
|