@php $statusClass = match ($file->status) { \App\Models\EnothiFile::STATUS_APPROVED, \App\Models\EnothiFile::STATUS_CLOSED => 'success', \App\Models\EnothiFile::STATUS_REJECTED => 'danger', \App\Models\EnothiFile::STATUS_IN_REVIEW, \App\Models\EnothiFile::STATUS_SUBMITTED => 'warning', \App\Models\EnothiFile::STATUS_RETURNED => 'dark', default => 'secondary', }; $isAdmin = auth()->user()->user_type === 'admin'; $approveRoute = $isAdmin ? route('enothi.approve', $file->id) : route('employee.enothi.approve', $file->id); $rejectRoute = $isAdmin ? route('enothi.reject', $file->id) : route('employee.enothi.reject', $file->id); $sendBackRoute = $isAdmin ? route('enothi.send_back', $file->id) : route('employee.enothi.send_back', $file->id); $forwardRoute = $isAdmin ? route('enothi.forward', $file->id) : route('employee.enothi.forward', $file->id); $forwardUsers = $forwardUsers ?? collect(); $nextApprover = $nextApprover ?? null; $attachmentDownloadRoute = $isAdmin ? 'enothi.attachments.download' : 'employee.enothi.attachments.download'; $noteDownloadRoute = $isAdmin ? 'enothi.notes.download' : 'employee.enothi.notes.download'; $noteRoute = $isAdmin ? route('enothi.note', $file->id) : null; $slaOverdue = !empty($isOverdue) && $isOverdue; $noteAttachments = $file->notes->filter(fn ($note) => filled($note->attachment_path)); $hasAttachments = $file->attachments->isNotEmpty() || $noteAttachments->isNotEmpty(); @endphp
{{ $file->subject }}
{{ __('File No.') }} {{ $file->file_number }}
{{ __('Category') }} {{ \App\Models\EnothiFile::categoryLabel($file->category, $file->enothi_category_id) }}
@if($file->staff?->user)
{{ __('Employee') }} {{ $file->staff->user->name }} {{ $file->staff->user_id }} @if($file->staff->warehouse?->name) · {{ $file->staff->warehouse->name }} @endif @if($file->staff->designation?->name) · {{ $file->staff->designation->name }} @endif
@endif @if($file->toStaff?->user)
{{ __('To') }} {{ $file->toStaff->user->name }} @if($file->toStaff->designation?->name) ({{ $file->toStaff->designation->name }}) @endif
@endif
@if($file->isDirectToOnly()) {{ __('Confidential — direct to recipient') }} @endif @if($file->priority === \App\Models\EnothiFile::PRIORITY_URGENT) {{ __('Urgent') }} @endif {{ \App\Models\EnothiFile::statusLabel($file->status) }} @if($file->level_due_at && in_array($file->status, [\App\Models\EnothiFile::STATUS_IN_REVIEW, \App\Models\EnothiFile::STATUS_SUBMITTED], true))
{{ __('SLA due') }}: {{ $file->level_due_at->format('Y-m-d H:i') }} @if($slaOverdue) — {{ __('Overdue') }} @endif
@endif @if($file->submitted_at)
{{ __('Submitted') }}: {{ $file->submitted_at->format('Y-m-d H:i') }}
@endif @if($file->returned_at)
{{ __('Returned') }}: {{ $file->returned_at->format('Y-m-d H:i') }}
@endif
@if($hasAttachments)
{{ __('Attachments') }}
{{ $file->attachments->count() + $noteAttachments->count() }} {{ __('file(s)') }}
@foreach($file->attachments as $att) {{ $att->original_name }} @endforeach @foreach($noteAttachments as $note) {{ basename($note->attachment_path) }} ({{ __('Note') }}) @endforeach
@endif @include('admin.enothi.partials.approval_stage_stepper', ['file' => $file])
{{ __('Noting Timeline') }} / {{ __('নথি') }}
@forelse($file->notes as $note)
{{ $note->author?->name ?? '—' }} @if($note->author?->staff?->designation) ({{ $note->author->staff->designation->name }}) @endif · {{ \App\Models\EnothiNote::typeLabel($note->note_type) }} @if($note->level) · {{ __('Level') }} {{ $note->level }} @endif {{ $note->created_at?->format('Y-m-d H:i') }}
{!! nl2br(e($note->body)) !!}
@if(filled($note->attachment_path)) @endif
@empty

{{ __('No notes yet.') }}

@endforelse
@if(!empty($canAct) && $canAct)
{{ __('Your action required') }}
@csrf
@if(! empty($nextApprover))
{{ __('After approval, this file will be forwarded to') }}:
{{ $nextApprover['name'] }} @if(! empty($nextApprover['designation'])) · {{ $nextApprover['designation'] }} @endif @if(! empty($nextApprover['branch'])) · {{ $nextApprover['branch'] }} @endif {{ __('Level') }} {{ $nextApprover['level'] }}
@else
{{ __('This is the final approval stage. Submitting will fully approve this file.') }}
@endif

{{ __('Send this file to a colleague at the same level with a forward note.') }}

@csrf
@csrf
@endif @if(!empty($noteRoute))
{{ __('Add observation (without approval action)') }}
@csrf
@endif @push('css') @endpush @push('script') @endpush