bc4739877c
FossilOrigin-Name: 467790c5738a867592117ea6b3a7ac6c61738dab3b8e29a48fed8f19b9df2b38
41 lines
793 B
PHP
41 lines
793 B
PHP
<?php
|
|
|
|
namespace Paheko\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;
|
|
}
|
|
}
|
|
}
|