@php $hasClientHours = !empty($has_client_hours); $coreShiftRows = $core_shift_data ?? collect(); $hasCoreClientHours = $coreShiftRows->contains(function ($row) { return !empty($row['client_hours']); }); $baseCols = 16 + ($hasClientHours ? 1 : 0); $coreBaseCols = 16 + ($hasCoreClientHours ? 1 : 0); // Staff view columns $staffViewCols = 5; @endphp
@if (!empty($is_core_shift_permitted)) @endif
{{-- Detailed View Tab --}}
@foreach ($client_name as $address => $name) @endforeach {{-- Updated Header Row --}} @if ($hasClientHours) @endif {{-- New Category Columns --}} @php $grouped = $roster_data->groupBy('date_label'); @endphp @foreach ($grouped as $dateLabel => $rows) {{-- Date group band --}} @foreach ($rows as $row) @php $rowStyle = ''; if (!empty($row['row_bg_color'])) { $rowStyle .= 'background-color: ' . $row['row_bg_color'] . ';'; } if (!empty($row['row_text_color'])) { $rowStyle .= ' color: ' . $row['row_text_color'] . ';'; } @endphp @if ($hasClientHours) @endif {{-- New Category Hours Columns --}} @endforeach @endforeach

Participant Name {!! nl2br($name) !!}
Participant Address {!! nl2br($address) !!}
Notes {!! nl2br($notes) !!}
Week Start {!! nl2br($week_start) !!} Week End {!! nl2br($week_end) !!}
Staff No Shift Staff Start Time End Time Break Time Total Hours Total Hours After BreakClient HoursAM PM AN PN Sat Sun Holiday
{{ $dateLabel }}
{{ isset($row['staff_no']) ? 'Staff ' . $row['staff_no'] : ''}} {{ $row['shift'] }} {{ $row['staff_name'] }} {{ $row['start_time'] }} {{ $row['end_time'] }} {{ $row['break_time'] }} {{ number_format($row['total_hours_incl_break'], 2) }} {{ number_format($row['total_hours_excl_break'], 2) }} @if (!empty($row['client_hours'])) @if ($view_time_in_client_hours_roster_pdf) @endif @foreach ($row['client_hours'] as $clientHour) @if ($view_time_in_client_hours_roster_pdf) @endif @endforeach @if(!empty($row['client_hours'])) @if ($view_time_in_client_hours_roster_pdf) @endif @if ($view_time_in_client_hours_roster_pdf) @endif @endif
ClientTimeHours
{{ $clientHour['client_name'] }} @php $st = $clientHour['start_time'] ?? ''; $et = $clientHour['end_time'] ?? ''; @endphp {{ $st && $et ? ($st . ' → ' . $et) : '-' }} {{ $clientHour['hours'] }}
Total Hours{{ $row['total_hours_excl_break'] }}
Break Hours{{ $clientHour['break_time'] ?? '00:00' }}
@endif
{{ $row['am_hours'] > 0 ? number_format($row['am_hours'], 2) : '' }} {{ $row['pm_hours'] > 0 ? number_format($row['pm_hours'], 2) : '' }} {{ $row['an_hours'] > 0 ? number_format($row['an_hours'], 2) : '' }} {{ $row['pn_hours'] > 0 ? number_format($row['pn_hours'], 2) : '' }} {{ $row['saturday_hours'] > 0 ? number_format($row['saturday_hours'], 2) : '' }} {{ $row['sunday_hours'] > 0 ? number_format($row['sunday_hours'], 2) : '' }} {{ $row['holiday_hours'] > 0 ? number_format($row['holiday_hours'], 2) : '' }}
{{-- Staff View Tab --}}
@foreach ($client_name as $address => $name) @endforeach {{-- Staff View Header Row --}} @foreach ($staff_view_data ?? [] as $row) @endforeach

Participant Name {!! nl2br($name) !!}
Participant Address {!! nl2br($address) !!}
Notes {!! nl2br($notes) !!}
Week Start {!! nl2br($week_start) !!} Week End {!! nl2br($week_end) !!}
Date AM PM AN PN
{{ $row['date'] }} @if (!empty($row['am'])) @foreach ($row['am'] as $staff) {{ $staff['name'] }}@if (!$loop->last), @endif @endforeach @else - @endif @if (!empty($row['pm'])) @foreach ($row['pm'] as $staff) {{ $staff['name'] }}@if (!$loop->last), @endif @endforeach @else - @endif @if (!empty($row['an'])) @foreach ($row['an'] as $staff) {{ $staff['name'] }}@if (!$loop->last), @endif @endforeach @else - @endif @if (!empty($row['pn'])) @foreach ($row['pn'] as $staff) {{ $staff['name'] }}@if (!$loop->last), @endif @endforeach @else - @endif
{{-- Core Shift Tab --}} @if (!empty($is_core_shift_permitted))
@foreach ($client_name as $address => $name) @endforeach {{-- Updated Header Row --}} @if ($hasCoreClientHours) @endif {{-- New Category Columns --}} @php $coreGrouped = collect($coreShiftRows)->groupBy('date_label'); @endphp @if ($coreGrouped->isEmpty()) @else @foreach ($coreGrouped as $dateLabel => $rows) {{-- Date group band --}} @foreach ($rows as $row) @php $rowStyle = ''; if (!empty($row['row_bg_color'])) { $rowStyle .= 'background-color: ' . $row['row_bg_color'] . ';'; } if (!empty($row['row_text_color'])) { $rowStyle .= ' color: ' . $row['row_text_color'] . ';'; } @endphp @if ($hasCoreClientHours) @endif {{-- New Category Hours Columns --}} @endforeach @endforeach @endif

Participant Name {!! nl2br($name) !!}
Participant Address {!! nl2br($address) !!}
Notes {!! nl2br($notes) !!}
Week Start {!! nl2br($week_start) !!} Week End {!! nl2br($week_end) !!}
Staff No Shift Staff Start Time End Time Break Time Total Hours Total Hours After BreakClient HoursAM PM AN PN Sat Sun Holiday
No core shifts found.
{{ $dateLabel }}
{{ isset($row['staff_no']) ? 'Staff ' . $row['staff_no'] : ''}} {{ $row['shift'] }} {{ $row['staff_name'] }} {{ $row['start_time'] }} {{ $row['end_time'] }} {{ $row['break_time'] }} {{ number_format($row['total_hours_incl_break'], 2) }} {{ number_format($row['total_hours_excl_break'], 2) }} @if (!empty($row['client_hours'])) @foreach ($row['client_hours'] as $clientHour) @endforeach @if(!empty($row['client_hours'])) @endif
Client Time Hours
{{ $clientHour['client_name'] }} @php $st = $clientHour['start_time'] ?? ''; $et = $clientHour['end_time'] ?? ''; @endphp {{ $st && $et ? ($st . ' → ' . $et) : '-' }} {{ $clientHour['hours'] }}
Total Hours {{ $row['total_hours_excl_break'] }}
Break Hours {{ $clientHour['break_time'] ?? '00:00' }}
@endif
{{ $row['am_hours'] > 0 ? number_format($row['am_hours'], 2) : '' }} {{ $row['pm_hours'] > 0 ? number_format($row['pm_hours'], 2) : '' }} {{ $row['an_hours'] > 0 ? number_format($row['an_hours'], 2) : '' }} {{ $row['pn_hours'] > 0 ? number_format($row['pn_hours'], 2) : '' }} {{ $row['saturday_hours'] > 0 ? number_format($row['saturday_hours'], 2) : '' }} {{ $row['sunday_hours'] > 0 ? number_format($row['sunday_hours'], 2) : '' }} {{ $row['holiday_hours'] > 0 ? number_format($row['holiday_hours'], 2) : '' }}
@endif