$weekTimesheet && $weekTimesheet->status == 'pending', 'badge-success' => $weekTimesheet && $weekTimesheet->status == 'approved', 'badge-danger' => (($weekTimesheet && $weekTimesheet->status == 'draft') || !$weekTimesheet), ])>{{ $weekTimesheet ? __('app.' . $weekTimesheet->status) : __('app.draft') }}
@csrf
@lang('app.task') @foreach ($weekPeriod->toArray() as $date)
{{ $date->day }}
{{ $date->translatedFormat('l') }}
{{ $date->translatedFormat('M') }}
@endforeach
@php $totalHours = []; @endphp @if($weekTimesheet) @php $key = 0; @endphp @foreach($weekTimesheet->entries->groupBy('task_id') as $key => $entries)
@if($weekTimesheet->status == 'draft') @endif
@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 @if (!\Carbon\Carbon::parse($day)->isFuture()) @else -- @endif @endforeach @endforeach @else @php $key = 0; @endphp
@foreach ($weekDates as $key2 => $day) @if (!\Carbon\Carbon::parse($day)->isFuture()) @else -- @endif @endforeach @endif @lang('app.total') @foreach ($weekDates as $key2 => $day) {{ $totalHours[$day] ?? 0 }} @lang('app.hrs') @endforeach
@if ($weekTimesheet && $weekTimesheet->status == 'draft' || !$weekTimesheet)
@lang('app.addMore') @lang('app.save') @lang('modules.timeLogs.submitForApproval')
@endif