@extends('layouts.app') @php use App\Models\Permission; use App\Models\RecordRetrieval; use App\Support\Format; $canManage = auth()->user()->hasPermission(Permission::RECORD_MANAGE); $out = $file->retrievals->firstWhere('returned_on', null); $missing = $file->missingDocuments(); @endphp @section('title', 'Agreement file — '.$file->showroom) @section('heading', 'Agreement file — '.$file->showroom) @section('subheading', $file->label.' · cabinet '.$file->cabinet.' · '.$file->classification) @section('actions') @if ($canManage) Edit @endif Retrieval log All files @endsection @section('content') @if ($errors->any())
Please check the {{ $errors->count() }} highlighted {{ \Illuminate\Support\Str::plural('entry', $errors->count()) }} below.
@endif {{-- ---------------------------------------------------------------- --}} {{-- Where it is --}} {{-- ---------------------------------------------------------------- --}}
Where it is
{{ $file->location_label }}
Landlord
{{ $file->landlord ?: '—' }}
Opened
{{ Format::date($file->opened_on) }}
Kept until
@if ($file->retain_until) {{ Format::date($file->retain_until) }} @if ($file->isPastRetention()) due a clear-out @endif @else while the tenancy runs @endif
@if ($file->proposal)
Proposal
{{ $file->proposal->outlet }}
@endif
@if ($out) @endif
{{-- ---------------------------------------------------------------- --}} {{-- Taking it out, and logging it back in --}} {{-- ---------------------------------------------------------------- --}} @if ($canManage && ! $file->isDisposed())
{{ $out ? 'Log the file back in' : 'Take the file out' }} clause 10.3.2
@if ($out)
@csrf @method('PUT') {{-- The line as written when it went out, so saving the return does not blank it. --}}
@error('returned_on')
{{ $message }}
@enderror
@error('received_by_name')
{{ $message }}
@enderror
@else
@csrf
@error('retrieved_on')
{{ $message }}
@enderror
@error('retrieved_by_name')
{{ $message }}
@enderror
@error('purpose')
{{ $message }}
@enderror
@error('approved_by_name')
{{ $message }}
@enderror
@error('approval_mode')
{{ $message }}
@enderror
@error('due_back_on')
{{ $message }}
@enderror
The file is {{ $file->classification }} — clause 10.3.1 wants the approval of the PA to GMD, the TE or the PTM before it leaves.
@endif
@endif {{-- ---------------------------------------------------------------- --}} {{-- What is in it --}} {{-- ---------------------------------------------------------------- --}}
What is in it clause 10.2.1 @if ($file->isComplete()) Complete @else {{ count($missing) }} still to file @endif
@foreach ($sequence as $document) @endforeach
 DocumentFiledRemarks
@if ($document['filed']) @else @endif ({{ $document['letter'] }}) {{ $document['title'] }} @if ($document['optional']) — if any @endif {{ Format::date($document['filed_on']) }} {{ $document['remarks'] ?: '—' }}
@if ($file->remarks) @endif
{{-- ---------------------------------------------------------------- --}} {{-- The retrieval log for this file --}} {{-- ---------------------------------------------------------------- --}}
Records Retrieval Log clause 10.3.2 {{ $file->retrievals->count() }} {{ \Illuminate\Support\Str::plural('entry', $file->retrievals->count()) }}
@if ($file->retrievals->isEmpty())
This file has never left the cabinet.
@else
@foreach ($file->retrievals as $retrieval) @endforeach
Out Retrieved by What for Approved by Back  
{{ Format::date($retrieval->retrieved_on) }} {{ $retrieval->retrieved_by_name }} {{ $retrieval->purpose ?: '—' }} {{ $retrieval->approved_by_name ?: '—' }}
{{ $retrieval->approval_mode_label }}
@if ($retrieval->returned_on) {{ Format::date($retrieval->returned_on) }}
{{ $retrieval->received_by_name ?: '—' }}
@else {{ $retrieval->statusLabel() }} @endif
@if ($canManage)
@csrf @method('DELETE')
@endif
@endif
@endsection