@extends('layouts.app') @php use App\Models\MonthlyRentalAdvice; use App\Models\Permission; use App\Support\Format; use App\Support\ProcedureProgress; $canManage = auth()->user()->hasPermission(Permission::MORA_MANAGE); // Step code => the column prefix that records it, so each row of the // procedure can carry its own pair of inputs. $prefixes = MonthlyRentalAdvice::STEPS; @endphp @section('title', 'Rental advice — '.$advice->period_label) @section('heading', 'Rental advice — '.$advice->period_label) @section('subheading', 'MORA · clause 9.0'.($advice->reference ? ' · '.$advice->reference : '')) @section('actions') Print PDF @if ($canManage && ! $advice->isLocked())
@csrf
@endif All advices @endsection @section('content') @if ($errors->any())
Please check the {{ $errors->count() }} highlighted {{ \Illuminate\Support\Str::plural('entry', $errors->count()) }} below.
@endif @php($missing = $advice->linesMissingFigures()) @if ($missing > 0)
{{ $missing }} of {{ $advice->outlet_count }} {{ \Illuminate\Support\Str::plural('outlet', $advice->outlet_count) }} {{ $missing === 1 ? 'has' : 'have' }} no rent recorded in the tenancy register, so {{ $missing === 1 ? 'it is' : 'they are' }} advising nothing. Enter the rent against {{ $missing === 1 ? 'that outlet' : 'those outlets' }} and redraw the advice.
@endif {{-- ---------------------------------------------------------------- --}} {{-- The totals --}} {{-- ---------------------------------------------------------------- --}}
Outlets
{{ number_format($advice->outlet_count) }}
Base rent
{{ Format::money($advice->base_total) }}
Service
{{ Format::money($advice->service_total) }}
Promotion
{{ Format::money($advice->promotion_total) }}
Tax
{{ Format::money($advice->tax_total) }}
Total payable (RM)
{{ Format::money($advice->total_amount) }}
@if ($advice->isLocked()) @endif
{{-- ---------------------------------------------------------------- --}} {{-- The five hand-offs, clauses 9.1 to 9.5 --}} {{-- ---------------------------------------------------------------- --}}
@csrf @method('PUT') @foreach ($stages as $stage)
{{ $stage['clause'] }} — {{ $stage['title'] }} {{ $progress['done'] }} of {{ $progress['total'] }} signed @if ($progress['overdue'] > 0) · {{ $progress['overdue'] }} overdue @endif
@foreach ($stage['steps'] as $step) @php($prefix = $prefixes[$step['code']])
{{ ProcedureProgress::statusLabel($step['status']) }} {{ $step['title'] }}
Clause {{ $step['clause'] }} · {{ $step['owner_label'] }} · {{ $step['allowance'] }} @if ($step['due_on']) · due {{ Format::date($step['due_on']) }} @endif @if ($step['status'] === ProcedureProgress::OVERDUE) — {{ $step['days_late'] }} working {{ \Illuminate\Support\Str::plural('day', $step['days_late']) }} over @elseif ($step['status'] === ProcedureProgress::LATE) — {{ $step['days_late'] }} working {{ \Illuminate\Support\Str::plural('day', $step['days_late']) }} late @endif
@error($prefix.'_on')
{{ $message }}
@enderror
@error($prefix.'_by_name')
{{ $message }}
@enderror
@endforeach
@endforeach
Remarks
@error('remarks')
{{ $message }}
@enderror
@if ($canManage)
@endif
{{-- ---------------------------------------------------------------- --}} {{-- The outlets --}} {{-- ---------------------------------------------------------------- --}}
Outlets advised {{ $advice->lines->count() }} lines
@if ($advice->lines->isEmpty())
No outlet was paying rent in {{ $advice->period_label }}.
@else
@foreach ($advice->lines as $line) @endforeach
Outlet Landlord Term Base rent Service Promotion Tax Total (RM)
{{ $line->outlet }} @if ($line->location)
{{ $line->location }}
@endif
{{ $line->landlord ?: '—' }} {{ $line->rent_year_label }} {{ Format::money($line->base_rent) }} {{ Format::money($line->service_charge) }} {{ Format::money($line->promotion_charge) }} {{ Format::money($line->tax_amount) }} {{ Format::money($line->total_amount) }}
Total {{ Format::money($advice->base_total) }} {{ Format::money($advice->service_total) }} {{ Format::money($advice->promotion_total) }} {{ Format::money($advice->tax_total) }} {{ Format::money($advice->total_amount) }}
@endif
@endsection