@extends('layouts.portal') @section('title', 'Financial Report') @section('page_title', 'Financial Report') @section('page_subtitle', 'Will and trust amounts, payments received, and outstanding balances') @section('sidebar') @include('agent.partials.sidebar', ['active' => 'reports-financial']) @endsection @section('content')

Financial Report

Payments received and outstanding balances per will

Total Will Amount

RM {{ number_format($stats['total_will_amount'], 2) }}

Received

RM {{ number_format($stats['total_received'], 2) }}

Outstanding

RM {{ number_format($stats['total_outstanding'], 2) }}

Paid / Pending

{{ $stats['paid_count'] }} / {{ $stats['pending_count'] }}

@forelse($rows as $i => $row) @empty @endforelse
Client Will Amount Paid Outstanding Status Last Payment Method Recorded By Will Written Invoices
{{ $row['client_name'] }}
{{ $row['doc_type'] }} #{{ $row['doc_id'] }}
RM {{ number_format($row['will_amount'], 2) }} RM {{ number_format($row['total_paid'], 2) }} RM {{ number_format($row['outstanding_balance'], 2) }} {{ ucfirst($row['payment_status']) }} {{ $row['last_payment_date'] ? \Carbon\Carbon::parse($row['last_payment_date'])->format('M d, Y') : '—' }} {{ $row['last_payment_method'] ?? '—' }} {{ $row['recorded_by'] ?? '—' }} {{ \Carbon\Carbon::parse($row['will_written_date'])->format('M d, Y') }}
No records found
@if($rows instanceof \Illuminate\Pagination\LengthAwarePaginator && $rows->hasPages())
{{ $rows->links() }}
@endif
@endsection