@extends('layouts.portal') @section('title', 'Wills Report') @section('page_title', 'Wills Report') @section('page_subtitle', 'Comprehensive will information and statistics') @section('sidebar') @include('admin.partials.sidebar', ['active' => 'reports-master']) @endsection @section('content')
Total Wills: {{ $wills->total() }}
| Doc Type | Will ID | Client Name | Client IC | Will Type | Status | Created Date | Created By | Version | Version Date | Version Edited By | Invoice Raised | Invoice Date | Subtotal (RM) | Tax (RM) | Discount (RM) | Total (RM) | L1 Commission (RM) | L2 Commission (RM) | L3 Commission (RM) | Total Commission (RM) | Lawyer Commission (RM) | Creator Role | Net Profit (RM) | Edit Request Profit (RM) | Edit Payment Date | Sections Edited | Total Profit (RM) | Admin Approved | Approval Date | Witness Names |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $will['document_type'] }} | {{ $will['id'] }} | {{ $will['client_name'] }} | {{ $will['client_ic'] }} | {{ ucfirst(str_replace('_', ' ', $will['will_type'])) }} | @php $statusClass = match($will['status']) { 'completed' => 'bg-green-100 text-green-800', 'draft' => 'bg-yellow-100 text-yellow-800', 'pending_approval' => 'bg-orange-100 text-orange-800', default => 'bg-gray-100 text-gray-800' }; @endphp {{ ucfirst(str_replace('_', ' ', $will['status'])) }} | {{ is_string($will['created_at']) ? $will['created_at'] : $will['created_at']->format('d M Y') }} | {{ $will['created_by_name'] }} | v{{ $will['version'] }} | {{ is_string($will['version_date']) ? $will['version_date'] : $will['version_date']->format('d M Y H:i') }} |
{{ $will['version_edited_by'] }}
{{ $will['version_edited_by_role'] }}
|
{{ $will['invoice_raised'] }} | {{ $will['invoice_date'] ? (is_string($will['invoice_date']) ? $will['invoice_date'] : $will['invoice_date']->format('d M Y')) : '-' }} | {{ number_format($will['subtotal'], 2) }} | {{ number_format($will['tax'], 2) }} | {{ number_format($will['discount'], 2) }} | {{ number_format($will['invoice_amount'], 2) }} | {{ number_format($will['l1_commission'], 2) }} | {{ number_format($will['l2_commission'], 2) }} | {{ number_format($will['l3_commission'], 2) }} | {{ number_format($will['total_commission'], 2) }} | {{ number_format($will['lawyer_commission'], 2) }} | @php $roleClass = match($will['created_by_role']) { 'agent' => 'bg-blue-100 text-blue-800', 'lawyer' => 'bg-purple-100 text-purple-800', default => 'bg-gray-100 text-gray-800' }; @endphp {{ ucfirst($will['created_by_role']) }} | {{ number_format($will['will_profit'], 2) }} ({{ number_format($will['invoice_amount'], 2) }} - {{ number_format($will['total_commission'], 2) }}) | {{ number_format($will['edit_request_profit'], 2) }} | {{ $will['edit_request_payment_date'] ? (is_string($will['edit_request_payment_date']) ? $will['edit_request_payment_date'] : $will['edit_request_payment_date']->format('d M Y H:i')) : '-' }} | @if(count($will['edited_sections']) > 0) @foreach($will['edited_sections'] as $section) {{ ucfirst(str_replace('_', ' ', $section)) }} @endforeach @else - @endif | {{ number_format($will['total_profit'], 2) }} ({{ number_format($will['will_profit'], 2) }} + {{ number_format($will['edit_request_profit'], 2) }}) | {{ $will['admin_approved'] }} | {{ $will['approval_date'] ? (is_string($will['approval_date']) ? $will['approval_date'] : $will['approval_date']->format('d M Y H:i')) : '-' }} | {{ $will['witness_names'] ?: '-' }} |
| No wills or trusts found | ||||||||||||||||||||||||||||||