@php $days = $this->days; $projects = $this->projects; $fmt = fn (float $h): string => rtrim(rtrim(number_format($h, 2, ',', ' '), '0'), ','); // Totaux par jour et total semaine (depuis l'état saisi). $dayTotals = []; $weekTotal = 0.0; foreach ($days as $d) { $sum = 0.0; foreach (array_keys($projects) as $pid) { $sum += (float) ($this->hours[$pid][$d['date']] ?? 0); } $dayTotals[$d['date']] = $sum; $weekTotal += $sum; } @endphp {{-- Week navigation + missing-days banner --}}

{{ $this->weekLabel }}

Cette semaine
@if ($this->missingCount > 0) {{ $this->missingCount }} jour(s) ouvré(s) manquant(s) @else Semaine complète @endif
{{-- Weekly grid: one row per assigned market, one column per day --}}
@foreach ($days as $d) @endforeach @forelse ($projects as $projectId => $projectName) @php $estInterne = (string) $projectId === \App\Services\Timesheets\TimesheetService::SANS_MARCHE; @endphp $estInterne])> @foreach ($days as $d) @php $rowDayTotal = 0; @endphp @endforeach @empty @endforelse @foreach ($days as $d) @endforeach
Marché $d['is_today'], 'text-gray-400' => $d['is_weekend'], ])> {{ $d['label'] }} {{-- v3.10.0 §4 — Jour férié validé : la pastille dit qu'aucune heure n'est attendue. Le champ de saisie reste ouvert juste en dessous. --}} @if ($d['on_holiday']) {{ $d['holiday_label'] }} @endif Total
{{ $projectName }} {{-- v3.11.0 §4 — Cette ligne n'est pas un marché : c'est l'absence de marché. --}} @if ($estInterne) Heures qui ne concernent aucun marché @endif $d['is_weekend'] && ! $d['on_holiday'], 'bg-warning-50 dark:bg-warning-400/10' => $d['on_holiday'], ])> @if ($d['locked']) {{ isset($this->hours[$projectId][$d['date']]) ? $fmt((float) $this->hours[$projectId][$d['date']]) : '—' }} 🔒 @elseif ($d['on_leave']) Congé @else @endif @php $rowTotal = 0.0; foreach ($days as $d) { $rowTotal += (float) ($this->hours[$projectId][$d['date']] ?? 0); } @endphp {{ $fmt($rowTotal) }}
Aucun marché à afficher — utilisez « Ajouter un marché à ma semaine » ci-dessus.
Total / jour $d['is_working'] && ! $d['on_leave'] && ! $d['on_holiday'] && $dayTotals[$d['date']] <= 0 && ! $d['locked'], 'text-gray-700 dark:text-gray-300' => ! ($d['is_working'] && ! $d['on_leave'] && ! $d['on_holiday'] && $dayTotals[$d['date']] <= 0), ])>{{ $fmt($dayTotals[$d['date']]) }}{{ $fmt($weekTotal) }} h
{{-- Save action --}}
Enregistrer ma semaine