feat(rtt) : paiement RTT rétroactif sur l'exercice précédent (#23)
Auto Tag Develop / tag (push) Successful in 7s
Auto Tag Develop / tag (push) Successful in 7s
## Besoin RH Pouvoir saisir un paiement RTT sur l'exercice précédent (ex. RTT de mai réglés après la bascule du 1er juin). ## Implémentation (Option B) - Paiement autorisé sur l'exercice courant + l'exercice immédiatement précédent (N-1). - Après saisie sur N-1, le report d'ouverture de l'exercice courant est recalculé automatiquement (computeClosingBalance) dans une transaction → aucun double comptage. - Refus si ce report est verrouillé (is_locked) : la RH le déverrouille d'abord. - Fallback EmployeeRttSummaryProvider::resolveCarry aligné sur computeClosingBalance : disponible correct même sans ligne stockée. - Front : bouton « + Payer les RTT » actif sur l'exercice précédent. - Docs : CLAUDE.md, doc/rtt-tab.md, documentation-content.ts. ## Vérification - ✅ 172 tests OK, cs-fixer OK, conteneur compile. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: #23 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #23.
This commit is contained in:
@@ -20,6 +20,7 @@ use App\Repository\WorkHourRepository;
|
||||
use App\Security\EmployeeScopeService;
|
||||
use App\Service\Contracts\EmployeeContractPhaseResolver;
|
||||
use App\Service\Exercise\ExerciseYearResolver;
|
||||
use App\Service\Rtt\RttClosingBalanceService;
|
||||
use App\Service\Rtt\RttRecoveryComputationService;
|
||||
use DateTimeImmutable;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
@@ -43,6 +44,7 @@ final readonly class EmployeeRttSummaryProvider implements ProviderInterface
|
||||
private WorkHourRepository $workHourRepository,
|
||||
private EmployeeContractPhaseResolver $phaseResolver,
|
||||
private ExerciseYearResolver $exerciseYearResolver,
|
||||
private RttClosingBalanceService $rttClosingService,
|
||||
string $rttStartDate = '',
|
||||
) {
|
||||
$this->rttStartDate = '' !== $rttStartDate ? $rttStartDate : null;
|
||||
@@ -231,8 +233,12 @@ final readonly class EmployeeRttSummaryProvider implements ProviderInterface
|
||||
];
|
||||
}
|
||||
|
||||
// No stored report row yet (before the 1st-June rollover materialises it):
|
||||
// compute the previous exercise's full closing (opening + earned − paid) so the
|
||||
// carry already reflects retroactive payments and the incoming report — matching
|
||||
// what the rollover would persist. Falling back to earned-only would drop both.
|
||||
return [
|
||||
$this->rttRecoveryService->computeTotalRecoveryForExercise($employee, $year - 1),
|
||||
$this->rttClosingService->computeClosingBalance($employee, $year - 1),
|
||||
5,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user