@extends('layouts.app') @php use App\Support\AgeingBucket; @endphp @section('title', 'Ageing report') @section('heading', 'Tenancy ageing report') @section('subheading', 'As at '.now()->format('d M Y').' · '.$filter->describe()) @section('actions') @include('partials.export-buttons') @endsection @section('content')
Group rows by
Read the columns as
@if ($mode === AgeingBucket::MODE_CUMULATIVE) Columns build up: the 6-month column includes everything in the 3-month column, so the row will not add across to the total. @else Columns are exclusive three-month slices, matching the worksheet, so each row adds across to its total. @endif
@include('partials.filters', ['target' => 'tenancies.report.ageing', 'compact' => true])
{{ $groupBy === 'region' ? 'Ageing by region' : 'Ageing by category' }} — {{ number_format($grandTotal) }} records
@foreach ($buckets as $bucket) @endforeach @forelse ($rows as $row) @foreach ($buckets as $bucket) @php $count = $row['counts'][$bucket] ?? 0; @endphp @endforeach @empty @endforelse @if ($rows !== []) @foreach ($buckets as $bucket) @endforeach @endif
{{ $groupBy === 'region' ? 'Region' : 'Category' }} {{ AgeingBucket::shortLabel($bucket) }}
{{ AgeingBucket::label($bucket, $mode) }}
Total
{{ $row['label'] }} @if ($count > 0) {{ number_format($count) }} @else 0 @endif {{ number_format($row['total']) }}
No records match this filter.
All {{ $groupBy === 'region' ? 'regions' : 'categories' }} {{ number_format($totals[$bucket] ?? 0) }} {{ number_format($grandTotal) }}
@endsection