Compare commits

..

2 Commits

Author SHA1 Message Date
gitea-actions
9577a70ea3 chore: bump version to v0.1.57
All checks were successful
Auto Tag Develop / tag (push) Successful in 4s
Build Release Artefact / build (push) Successful in 1m9s
2026-03-19 17:18:17 +00:00
e85f7b6f4c fix : calcule des RTT
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
2026-03-19 18:18:06 +01:00
3 changed files with 18 additions and 8 deletions

View File

@@ -1,2 +1,2 @@
parameters: parameters:
app.version: '0.1.56' app.version: '0.1.57'

View File

@@ -230,26 +230,36 @@ final class WorkHourRepository extends ServiceEntityRepository implements WorkHo
public function isWeekFullyValidated(Employee $employee, DateTimeImmutable $from, DateTimeImmutable $to): bool public function isWeekFullyValidated(Employee $employee, DateTimeImmutable $from, DateTimeImmutable $to): bool
{ {
// At least one validated day must exist // Count weekdays (Mon-Fri) in range
$validatedCount = (int) $this->createQueryBuilder('w') $expectedWeekdays = 0;
for ($d = $from; $d <= $to; $d = $d->modify('+1 day')) {
if ((int) $d->format('N') <= 5) {
++$expectedWeekdays;
}
}
if (0 === $expectedWeekdays) {
return false;
}
// Every weekday must have a work_hour row
$totalCount = (int) $this->createQueryBuilder('w')
->select('COUNT(w.id)') ->select('COUNT(w.id)')
->andWhere('w.employee = :employee') ->andWhere('w.employee = :employee')
->andWhere('w.workDate >= :from') ->andWhere('w.workDate >= :from')
->andWhere('w.workDate <= :to') ->andWhere('w.workDate <= :to')
->andWhere('w.isValid = :isValid')
->setParameter('employee', $employee) ->setParameter('employee', $employee)
->setParameter('from', $from) ->setParameter('from', $from)
->setParameter('to', $to) ->setParameter('to', $to)
->setParameter('isValid', true)
->getQuery() ->getQuery()
->getSingleScalarResult() ->getSingleScalarResult()
; ;
if (0 === $validatedCount) { if ($totalCount < $expectedWeekdays) {
return false; return false;
} }
// No non-validated day must exist in the range // All rows must be validated
$nonValidatedCount = (int) $this->createQueryBuilder('w') $nonValidatedCount = (int) $this->createQueryBuilder('w')
->select('COUNT(w.id)') ->select('COUNT(w.id)')
->andWhere('w.employee = :employee') ->andWhere('w.employee = :employee')

View File

@@ -267,6 +267,6 @@ final readonly class EmployeeRttSummaryProvider implements ProviderInterface
} }
} }
return $weekEnd; return $today;
} }
} }