@extends('layouts.portal') @section('title', 'Will Report') @section('page_title', 'Will Report') @section('page_subtitle', 'Every will and trust, its progress, and the agents earning commission on it') @section('sidebar') @include('agent.partials.sidebar', ['active' => 'reports-wills']) @endsection @section('content')

Will Report

Type, version, writer, approval, commission by level, and full timeline per will

Total Documents

{{ $stats['total_wills'] }}

Approved

{{ $stats['approved_wills'] }}

Pending

{{ $stats['pending_wills'] }}

Total Commission

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

@forelse($rows as $i => $row) @foreach(['l1','l2','l3'] as $level) @endforeach @empty @endforelse
Client IC Document Type Ver Writer Status Approved L1 L2 L3 Details
{{ $row['client_name'] }}
{{ $row['doc_type'] }} #{{ $row['doc_id'] }}
{{ $row['ic_number'] }} {{ $row['doc_type'] }} {{ ucfirst($row['doc_subtype'] ?? '-') }} {{ $row['version'] }} {{ $row['will_writer'] }}
{{ ucfirst($row['will_writer_role']) }}
{{ ucfirst(str_replace('_',' ',$row['status'] ?? '-')) }} @if($row['approved_at']) {{ \Carbon\Carbon::parse($row['approved_at'])->format('M d, Y') }}
{{ $row['approved_by'] ?? '-' }} @else Pending @endif
@if($row[$level]['agent_name']) {{ $row[$level]['agent_name'] }}
RM {{ number_format($row[$level]['amount'], 2) }} {{ ucfirst($row[$level]['status'] ?? '') }} @else — @endif
No wills found
@if($rows instanceof \Illuminate\Pagination\LengthAwarePaginator && $rows->hasPages())
{{ $rows->links() }}
@endif
@endsection