@@ 381-402 (lines=22) @@ | ||
378 | * Restant a deposer avant d'atteindre le max pour l'annee |
|
379 | * @return number |
|
380 | */ |
|
381 | public function getYearlyMaxDeposit() |
|
382 | { |
|
383 | $right = $this->getDepositRight(false); |
|
384 | ||
385 | if (!isset($right)) |
|
386 | { |
|
387 | throw new Exception(absences_translate('The applicant time saving account is not accessible')); |
|
388 | } |
|
389 | ||
390 | $rightcet = $right->getRightCet(); |
|
391 | ||
392 | $per_year = (float) $rightcet->per_year; |
|
393 | ||
394 | if (0 === (int) round($per_year * 10)) |
|
395 | { |
|
396 | // no limit set |
|
397 | return null; |
|
398 | } |
|
399 | ||
400 | ||
401 | return ($per_year - $this->getYearlyDeposits()); |
|
402 | } |
|
403 | ||
404 | ||
405 | /** |
|
@@ 409-433 (lines=25) @@ | ||
406 | * Restant a deposer avant d'atteindre le plafont total |
|
407 | * @return number |
|
408 | */ |
|
409 | public function getMaxDepositTotal() |
|
410 | { |
|
411 | $right = $this->getDepositRight(false); |
|
412 | ||
413 | if (!isset($right)) |
|
414 | { |
|
415 | throw new Exception(absences_translate('The applicant time saving account is not accessible')); |
|
416 | } |
|
417 | ||
418 | $rightcet = $right->getRightCet(); |
|
419 | ||
420 | $celling = (float) $rightcet->ceiling; |
|
421 | ||
422 | if (0 === (int) round($celling * 10)) |
|
423 | { |
|
424 | // no limit set |
|
425 | return null; |
|
426 | } |
|
427 | ||
428 | return ($celling - $this->getTotalDeposits()); |
|
429 | ||
430 | ||
431 | ||
432 | // TODO available period deposits |
|
433 | } |
|
434 | ||
435 | ||
436 | /** |