[#SIRH-12] Export des heures d'un employé sur une année (#7)
Auto Tag Develop / tag (push) Has been cancelled
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #7 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #7.
This commit is contained in:
@@ -80,7 +80,8 @@ final readonly class EmployeeWriteProcessor implements ProcessorInterface
|
||||
}
|
||||
|
||||
$todayPeriod = $this->periodRepository->findOneCoveringDate($data, $today);
|
||||
$currentPeriodContract = $todayPeriod?->getContract();
|
||||
$effectivePeriod = $todayPeriod ?? $this->periodRepository->findLatestPeriod($data);
|
||||
$currentPeriodContract = $effectivePeriod?->getContract();
|
||||
$contractChanged = $currentPeriodContract instanceof Contract
|
||||
? $currentPeriodContract->getId() !== $currentContract->getId()
|
||||
: true;
|
||||
@@ -92,7 +93,7 @@ final readonly class EmployeeWriteProcessor implements ProcessorInterface
|
||||
throw new UnprocessableEntityHttpException('contractEndDate is required for close-only request.');
|
||||
}
|
||||
$this->periodManager->closeCurrentPeriod(
|
||||
$todayPeriod,
|
||||
$effectivePeriod,
|
||||
$requestedEndDate,
|
||||
$changeRequest->contractPaidLeaveSettled ?? false,
|
||||
$changeRequest->contractComment
|
||||
@@ -102,14 +103,14 @@ final readonly class EmployeeWriteProcessor implements ProcessorInterface
|
||||
}
|
||||
|
||||
$startDate = $changeRequest->contractStartDate ?? $today;
|
||||
$nature = $changeRequest->contractNature ?? $todayPeriod?->getContractNatureEnum() ?? ContractNature::CDI;
|
||||
$nature = $changeRequest->contractNature ?? $effectivePeriod?->getContractNatureEnum() ?? ContractNature::CDI;
|
||||
$this->periodManager->createNextPeriod(
|
||||
employee: $data,
|
||||
contract: $currentContract,
|
||||
startDate: $startDate,
|
||||
endDate: $changeRequest->contractEndDate,
|
||||
nature: $nature,
|
||||
todayPeriod: $todayPeriod,
|
||||
todayPeriod: $effectivePeriod,
|
||||
isDriver: $changeRequest->isDriver ?? false,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user