@extends('layouts.nav') @section('title', 'Rent Summary Report') @section('content')

Outstanding Rent Report

@if ($errors->any())
@endif
Report Filters
@csrf
Refresh
@if(request()->filled('report_type'))
{{-- Summary Report --}} @if(request()->input('report_type') == 'summary') @if($summaryData->isNotEmpty())
@foreach ($summaryData as $data) @endforeach
Date Tenant Code Name Balance
{{ \Carbon\Carbon::parse($data->entrydate)->format('d/m/Y') }} {{ $data->tenantcode }} {{ $data->tenant_name }} USD{{ number_format($data->total, 2) }}
Grand Total USD{{ number_format($grandTotal, 2) }}
@else

No rent collection data found for the selected currency and date range.

@endif @endif {{-- Detailed Report --}} @if(request()->input('report_type') == 'detailed') @if($detailedData->isNotEmpty())
@foreach ($detailedData as $tenantName => $transactions) @php // Get floor and room from the first transaction in the group $firstTxn = $transactions->first(); // Calculate tenant total for this group $tenantTotal = $transactions->sum('total'); @endphp

Tenant: {{ $tenantName }} | Floor: {{ $firstTxn->floor }} | Rooms: {{ $firstTxn->rooms }}

Space Occupied: {{ $firstTxn->space }}sqm

@php $tenantTotal = 0; @endphp @foreach ($transactions as $txn) @php $balance = ($txn->total ?? 0) - ($txn->dr ?? 0); $tenantTotal += $balance; @endphp @endforeach
Date Invoice Tax Discount Rent Amount(USD) Amount Paid(USD) Balance (USD)
{{ \Carbon\Carbon::parse($txn->entrydate)->format('d/m/Y') }} {{ $txn->batch }} {{ $txn->tax }} {{ $txn->discount }} {{ $txn->price }} {{ $txn->dr }} {{ number_format($balance, 2) }}
Closing balance for {{ $tenantName }} : USD{{ number_format($tenantTotal, 2) }}
@endforeach
@else

No rent collection data found for the selected currency and date range.

@endif @endif
@endif
@endsection