@if ($weeklyTimesheet->status == 'draft') @lang('app.edit') @endif @if ($weeklyTimesheet->status == 'pending' && (in_array('admin', user_roles()) || $weeklyTimesheet->user->employeeDetails->reporting_to == user()->id)) @lang('app.reject') @lang('app.approve') @else $weeklyTimesheet && $weeklyTimesheet->status == 'pending', 'badge-success' => $weeklyTimesheet && $weeklyTimesheet->status == 'approved', 'badge-danger' => (($weeklyTimesheet && $weeklyTimesheet->status == 'draft') || !$weeklyTimesheet), ])>{{ $weeklyTimesheet ? __('app.' . $weeklyTimesheet->status) : __('app.draft') }} @endif
@lang('modules.timeLogs.submittedBy')
@if ($weeklyTimesheet->approvedBy)
@lang('modules.expenses.approvedBy')
@endif
@lang('app.task') @foreach ($weekPeriod->toArray() as $date)
{{ $date->day }}
{{ $date->translatedFormat('l') }}
{{ $date->translatedFormat('M') }}
@endforeach
@php $totalHours = []; @endphp @if($weeklyTimesheet) @foreach($weeklyTimesheet->entries->groupBy('task_id') as $key => $entries) {{ $entries->first()->task->heading }} @foreach ($entries as $key2 => $entry) @php $day = $entry->date->format('Y-m-d'); @endphp @php $hours = $entry->hours ?? 0; if (isset($totalHours[$day])) { $totalHours[$day] = $totalHours[$day] + $hours; } else { $totalHours[$day] = $hours; } @endphp {{ $entry->hours }} @lang('app.hrs') @endforeach @endforeach @endif @lang('app.total') @foreach ($weekDates as $key2 => $day) {{ $totalHours[$day] ?? 0 }} @lang('app.hrs') @endforeach