@extends('layouts.app') @php use App\Models\Permission; $editing = $tenancy->exists; $action = $editing ? route('tenancies.update', $tenancy) : route('tenancies.store'); $canSeeMoney = auth()->user()->hasPermission(Permission::TENANCY_VIEW_FINANCIALS); $value = fn (string $field, $fallback = null) => old($field, $tenancy->{$field} ?? $fallback); $dateValue = fn (string $field) => old($field, $tenancy->{$field}?->format('Y-m-d')); /* | Amounts are shown grouped to two decimals — 15,000.00. A number input | will not hold a separator, so these fields are text with a decimal | keypad; the separators come off again in the browser on submit and in | TenancyRequest for anything posted without JavaScript. */ $amount = fn (string $field) => amount_value($value($field)); @endphp @section('title', $editing ? 'Edit tenancy' : 'Add tenancy') @section('heading', $editing ? 'Edit tenancy — '.$tenancy->outlet : 'Add a tenancy record') @section('actions') Cancel @endsection @section('content')
@csrf @if ($editing) @method('PUT') @endif
{{-- ---------------------------------------------------- --}} {{-- Identity --}} {{-- ---------------------------------------------------- --}}
Outlet & landlord
@error('seq_no')
{{ $message }}
@enderror
@error('tenancy_category_id')
{{ $message }}
@enderror
@error('region_id')
{{ $message }}
@enderror
@error('outlet')
{{ $message }}
@enderror
The outlet, unit and commencement date together identify a tenancy, and are what the importer checks to stop a duplicate being created.
@error('location')
{{ $message }}
@enderror
@error('landlord_id')
{{ $message }}
@enderror
Used only when no landlord is picked above.
@error('landlord_name')
{{ $message }}
@enderror
@if ($canSeeMoney)
Drives every monthly total: rate per sq ft × this area.
@endif
{{-- ---------------------------------------------------- --}} {{-- Period --}} {{-- ---------------------------------------------------- --}}
Tenancy period & renewal
@error('commencement_date')
{{ $message }}
@enderror
The expiry date drives the 3 / 6 / 9 / 12 month ageing buttons.
@error('expiry_date')
{{ $message }}
@enderror
@error('status')
{{ $message }}
@enderror
{{-- ---------------------------------------------------- --}} {{-- Money --}} {{-- ---------------------------------------------------- --}} @if ($canSeeMoney)
Rent & charges (RM)
@foreach (\App\Models\Tenancy::RENT_COMPONENTS as $prefix => $label) @endforeach
ItemRate / sq ftMonthly total
{{ $label }}
Each monthly total is the rate per sq ft times the area, worked out as you type. Leave the area blank to type the monthly figures yourself, as for a lump sum.
Refundable deposits (RM)
@foreach ([ 'deposit_security' => 'Security', 'deposit_fitout' => 'Fit-out', 'deposit_restoration' => 'Restoration', 'deposit_utility' => 'Utility', 'deposit_mailbox' => 'Mail box', 'deposit_others' => 'Others', ] as $field => $label)
@endforeach

Total deposit RM 0.00
Added up automatically from the six boxes above.
@endif
Cancel
@endsection