@extends('layouts.app') @php use App\Models\Permission; use App\Support\AgeingBucket; use App\Support\Format; $canSeeMoney = auth()->user()->hasPermission(Permission::TENANCY_VIEW_FINANCIALS); $sortLink = function (string $column) use ($filter) { $direction = ($filter->sort === $column && $filter->direction === 'asc') ? 'desc' : 'asc'; return route('tenancies.index', $filter->toQuery(['sort' => $column, 'dir' => $direction])); }; $sortIcon = function (string $column) use ($filter) { if ($filter->sort !== $column) { return 'bi-arrow-down-up opacity-25'; } return $filter->direction === 'asc' ? 'bi-sort-down-alt' : 'bi-sort-up-alt'; }; @endphp @section('title', $filter->archived ? 'Archived tenancies' : 'Tenancy records') @section('heading', $filter->archived ? 'Archived tenancies' : 'Tenancy Ageing — records') @section('subheading', $filter->describe()) @section('actions') @include('partials.export-buttons') @can(Permission::TENANCY_IMPORT) Import @endcan @can(Permission::TENANCY_CREATE) Add tenancy @endcan @endsection @section('content') @unless ($filter->archived) @include('partials.ageing-buttons', ['target' => 'tenancies.index']) @else
Showing archived records. They are kept so the activity trail stays complete. Back to active records.
@endunless @include('partials.filters', ['target' => 'tenancies.index'])
{{ number_format($tenancies->total()) }} {{ \Illuminate\Support\Str::plural('record', $tenancies->total()) }} @if ($filter->bucket) · {{ AgeingBucket::label($filter->bucket, $filter->mode) }} @endif
@foreach ($filter->toQuery() as $key => $value) @endforeach
@if ($canSeeMoney) @endif @forelse ($tenancies as $tenancy) @php $bucket = $tenancy->ageing_bucket; @endphp @if ($canSeeMoney) @endif @empty @endforelse
No Region Outlet Unit / location Landlord Commencing Expiry Ageing Total rent Status Renewal update
{{ $tenancy->seq_no ?? '—' }} {{ $tenancy->region?->code ?? '—' }} {{ $tenancy->outlet }}
{{ $tenancy->category?->name }}
{{ $tenancy->location ?? '—' }} {{ $tenancy->landlord?->name ?? '—' }} {{ $tenancy->display_commencement }} {{ $tenancy->display_expiry }}
{{ Format::countdown($tenancy->days_to_expiry, '') }}
{{ AgeingBucket::shortLabel($bucket) }} @money($tenancy->total_rent){{ $tenancy->status_label }} @if ($tenancy->renewal_stage_label) {{ $tenancy->renewal_stage_label }}
@endif {{ \Illuminate\Support\Str::limit($tenancy->renewal_remarks, 70) }}
@if ($filter->archived) @can(Permission::TENANCY_RESTORE)
@csrf
@endcan @else @can(Permission::TENANCY_UPDATE) @endcan @endif
No tenancy records match this filter. @if ($filter->hasAnyFilter()) Clear the filters to see everything. @endif
@if ($tenancies->hasPages()) @endif
@endsection