@extends('layouts.app') @section('title', 'Rent Collection') @section('page-title', 'Rent Collection') @section('content')

Rent Collection

Month-by-month collection status for managed rental properties — FY {{ $fyStart->format('Y') }}–{{ $fyStart->copy()->addYear()->format('y') }}
@if(session('success'))
{{ session('success') }}
@endif @php $totalRows = $rows->count(); $issueRows = $rows->where('rowClass', 'table-danger')->count(); $warningRows = $rows->where('rowClass', 'table-warning')->count(); @endphp
{{ $totalRows }}
Managed Properties
{{ $rows->sum('paidCount') }}
Collected (FY)
{{ $issueRows }}
Need Attention
{{ $warningRows }}
Overdue Previous Month
{{-- Legend --}}
Red — Current month unpaid (past 5th) Amber — Previous month unpaid Collected Pending Not Marked
@forelse($rows as $row) @php /** @var \App\Models\LeadAgreement $agr */ $agr = $row['agreement']; $property = $agr->property; $client = $agr->lead && $agr->lead->requirement ? $agr->lead->requirement->client : null; $statusBadge = [ 'collected' => ['bg-success bg-opacity-10 text-success', 'Collected'], 'not_collected' => ['bg-danger bg-opacity-10 text-danger', 'Pending'], 'not_marked' => ['bg-secondary bg-opacity-10 text-secondary', 'Not Marked'], ]; [$badgeCls, $badgeLabel] = $statusBadge[$row['thisStatus']] ?? $statusBadge['not_marked']; $isDeactivated = ! $agr->is_active; // Suppress overdue row highlighting for deactivated agreements $rowClass = $isDeactivated ? '' : $row['rowClass']; @endphp {{-- Deal Status (Active / Deactivated) --}} {{-- Current-month collection status --}} @empty @endforelse
Property Owner Tenant Agreement Period Monthly Rent Deal Status {{ $thisMonth->format('M Y') }} Paid (FY) Unpaid (FY) Actions
@if($property)
@if($property->trashed()) {{ $property->title }} @else {{ $property->title }} @endif @if($isDeactivated) Deactivated @endif
@if($property->city)
{{ $property->city }}
@endif @else @endif
@if($property && $property->owner) {{ $property->owner->name }} @else {{ $agr->owner_name ?: '—' }} @endif @if($client) {{ $client->full_name }} @else {{ $agr->client_name ?: '—' }} @endif {{ $agr->agreement_start_date ? $agr->agreement_start_date->format('d M Y') : '—' }} — {{ $agr->agreement_end_date ? $agr->agreement_end_date->format('d M Y') : '—' }} {{ $agr->monthly_rent ? '₹' . number_format((float) $agr->monthly_rent, 0) : '—' }} @if($isDeactivated) Deactivated @else Active @endif @if($isDeactivated) @else {{ $badgeLabel }} @endif {{ $row['paidCount'] }} {{ $row['unpaidCount'] }} @if($property) Checklist @endif @if($agr->document_path && $agr->lead) @endif
No managed properties with active tenants found.
Mark a rental property as Managed by {{ \App\Models\AppSetting::get('company_name', 'Agrawal Properties') }} on its detail page.
@endsection