fix : redirection après login + écran des heures chauffeurs
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
This commit is contained in:
@@ -127,14 +127,16 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
// Pré-calcul des métriques par salarié/date pour simplifier l'agrégation finale.
|
||||
$dateKey = $workHour->getWorkDate()->format('Y-m-d');
|
||||
$metricsByEmployeeDate[$employeeId][$dateKey] = [
|
||||
'metrics' => $this->computeMetrics($workHour),
|
||||
'isPresentMorning' => $workHour->getIsPresentMorning(),
|
||||
'isPresentAfternoon' => $workHour->getIsPresentAfternoon(),
|
||||
'dayHoursMinutes' => $workHour->getDayHoursMinutes(),
|
||||
'nightHoursMinutes' => $workHour->getNightHoursMinutes(),
|
||||
'hasBreakfast' => $workHour->getHasBreakfast(),
|
||||
'hasLunch' => $workHour->getHasLunch(),
|
||||
'hasOvernight' => $workHour->getHasOvernight(),
|
||||
'metrics' => $this->computeMetrics($workHour),
|
||||
'isPresentMorning' => $workHour->getIsPresentMorning(),
|
||||
'isPresentAfternoon' => $workHour->getIsPresentAfternoon(),
|
||||
'dayHoursMinutes' => $workHour->getDayHoursMinutes(),
|
||||
'nightHoursMinutes' => $workHour->getNightHoursMinutes(),
|
||||
'workshopHoursMinutes' => $workHour->getWorkshopHoursMinutes(),
|
||||
'hasBreakfast' => $workHour->getHasBreakfast(),
|
||||
'hasLunch' => $workHour->getHasLunch(),
|
||||
'hasDinner' => $workHour->getHasDinner(),
|
||||
'hasOvernight' => $workHour->getHasOvernight(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -185,14 +187,16 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
$weeklyDayMinutes = 0;
|
||||
$weeklyNightMinutes = 0;
|
||||
$weeklyTotalMinutes = 0;
|
||||
$weeklyPresenceCount = 0.0;
|
||||
$weeklyBreakfastCount = 0;
|
||||
$weeklyLunchCount = 0;
|
||||
$weeklyOvernightCount = 0;
|
||||
$daily = [];
|
||||
$weeklyDayMinutes = 0;
|
||||
$weeklyNightMinutes = 0;
|
||||
$weeklyWorkshopMinutes = 0;
|
||||
$weeklyTotalMinutes = 0;
|
||||
$weeklyPresenceCount = 0.0;
|
||||
$weeklyBreakfastCount = 0;
|
||||
$weeklyLunchCount = 0;
|
||||
$weeklyDinnerCount = 0;
|
||||
$weeklyOvernightCount = 0;
|
||||
$daily = [];
|
||||
// Les contrats au suivi "présence" ne manipulent pas les heures, mais des demi-journées.
|
||||
$weekAnchorContract = $contractsByEmployeeDate[$employeeId][$anchorDateYmd]
|
||||
?? $contractsByEmployeeDate[$employeeId][$days[0]]
|
||||
@@ -217,21 +221,27 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
|
||||
$hasBreakfast = false;
|
||||
$hasLunch = false;
|
||||
$hasDinner = false;
|
||||
$hasOvernight = false;
|
||||
|
||||
if ($isDateDriver) {
|
||||
$dayMinutes = ($entry['dayHoursMinutes'] ?? 0);
|
||||
$nightMinutes = ($entry['nightHoursMinutes'] ?? 0);
|
||||
$totalMinutes = $dayMinutes + $nightMinutes;
|
||||
$hasBreakfast = $entry['hasBreakfast'] ?? false;
|
||||
$hasLunch = $entry['hasLunch'] ?? false;
|
||||
$hasOvernight = $entry['hasOvernight'] ?? false;
|
||||
$dayMinutes = ($entry['dayHoursMinutes'] ?? 0);
|
||||
$nightMinutes = ($entry['nightHoursMinutes'] ?? 0);
|
||||
$workshopMinutes = ($entry['workshopHoursMinutes'] ?? 0);
|
||||
$totalMinutes = $dayMinutes + $nightMinutes + $workshopMinutes;
|
||||
$hasBreakfast = $entry['hasBreakfast'] ?? false;
|
||||
$hasLunch = $entry['hasLunch'] ?? false;
|
||||
$hasDinner = $entry['hasDinner'] ?? false;
|
||||
$hasOvernight = $entry['hasOvernight'] ?? false;
|
||||
if ($hasBreakfast) {
|
||||
++$weeklyBreakfastCount;
|
||||
}
|
||||
if ($hasLunch) {
|
||||
++$weeklyLunchCount;
|
||||
}
|
||||
if ($hasDinner) {
|
||||
++$weeklyDinnerCount;
|
||||
}
|
||||
if ($hasOvernight) {
|
||||
++$weeklyOvernightCount;
|
||||
}
|
||||
@@ -239,9 +249,10 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
$metrics = $entry['metrics'] ?? new WorkMetrics();
|
||||
// Les absences "comptées comme travaillées" alimentent le total du jour.
|
||||
$metrics->addCreditedMinutes($creditedMinutes);
|
||||
$dayMinutes = $metrics->dayMinutes;
|
||||
$nightMinutes = $metrics->nightMinutes;
|
||||
$totalMinutes = $metrics->totalMinutes;
|
||||
$dayMinutes = $metrics->dayMinutes;
|
||||
$nightMinutes = $metrics->nightMinutes;
|
||||
$workshopMinutes = 0;
|
||||
$totalMinutes = $metrics->totalMinutes;
|
||||
}
|
||||
|
||||
$present = null;
|
||||
@@ -256,6 +267,7 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
|
||||
$weeklyDayMinutes += $dayMinutes;
|
||||
$weeklyNightMinutes += $nightMinutes;
|
||||
$weeklyWorkshopMinutes += $workshopMinutes;
|
||||
$weeklyTotalMinutes += $totalMinutes;
|
||||
if (null !== $present) {
|
||||
$weeklyPresenceCount += $present;
|
||||
@@ -265,6 +277,7 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
date: $date,
|
||||
dayMinutes: $dayMinutes,
|
||||
nightMinutes: $nightMinutes,
|
||||
workshopMinutes: $workshopMinutes,
|
||||
totalMinutes: $totalMinutes,
|
||||
present: $present,
|
||||
hasAbsence: $absenceByEmployeeDate[$employeeId][$date] ?? false,
|
||||
@@ -272,6 +285,7 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
absenceColor: $absenceColorByEmployeeDate[$employeeId][$date] ?? null,
|
||||
hasBreakfast: $hasBreakfast,
|
||||
hasLunch: $hasLunch,
|
||||
hasDinner: $hasDinner,
|
||||
hasOvernight: $hasOvernight,
|
||||
);
|
||||
}
|
||||
@@ -304,6 +318,7 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
daily: $daily,
|
||||
weeklyDayMinutes: $weeklyDayMinutes,
|
||||
weeklyNightMinutes: $weeklyNightMinutes,
|
||||
weeklyWorkshopMinutes: $weeklyWorkshopMinutes,
|
||||
weeklyTotalMinutes: $weeklyTotalMinutes,
|
||||
weeklyPresenceCount: $weeklyPresenceCount,
|
||||
weeklyOvertimeTotalMinutes: $weeklyOvertimeTotalMinutes,
|
||||
@@ -313,6 +328,7 @@ final readonly class WorkHourWeeklySummaryProvider implements ProviderInterface
|
||||
isDriver: $isDriver,
|
||||
weeklyBreakfastCount: $weeklyBreakfastCount,
|
||||
weeklyLunchCount: $weeklyLunchCount,
|
||||
weeklyDinnerCount: $weeklyDinnerCount,
|
||||
weeklyOvernightCount: $weeklyOvernightCount,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user