@extends('layouts.portal') @section('title', 'Financial Report') @section('page_title', 'Financial Report') @section('page_subtitle', 'Detailed financial analysis by will') @section('sidebar') @include('admin.partials.sidebar', ['active' => 'reports-master']) @endsection @section('content')
Total Documents (Wills & Trusts): {{ $documents->total() }}
Total Invoice
RM {{ number_format($stats['total_invoice'], 2) }}
Total Commission
RM {{ number_format($stats['total_commission'], 2) }}
Total Payment
RM {{ number_format($stats['total_payment'], 2) }}
Total Profit
RM {{ number_format($stats['total_all'], 2) }}
| Document ID | Type | Client Name | Created By | Role | Invoice (RM) | Invoice Status | L1 Commission (RM) | L2 Commission (RM) | L3 Commission (RM) | Lawyer Commission (RM) | Total Commission (RM) | Net Profit (RM) | Version | Version Changes | Payment Status | Payment (RM) | Payment Method | Tax (RM) | Tax Rate % | Discount (RM) | Discount % | Total Paid (RM) | Edit Request Amount (RM) | Total Profit (RM) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $document['id'] }} | {{ $document['document_type'] }} | {{ $document['client_name'] }} | {{ $document['created_by_name'] }} | @php $roleClass = match($document['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 {{ $document['created_by_role'] }} | {{ number_format($document['invoice_amount'], 2) }} | {{ ucfirst($document['invoice_status']) }} | {{ number_format($document['l1_commission'], 2) }} | {{ number_format($document['l2_commission'], 2) }} | {{ number_format($document['l3_commission'], 2) }} | {{ number_format($document['lawyer_commission'], 2) }} | {{ number_format($document['total_commission'], 2) }} | {{ number_format($document['profit'], 2) }} | v{{ $document['document_version'] }} | {{ $document['version_changes'] }} | {{ $document['payment_status'] }} | {{ number_format($document['payment_amount'], 2) }} | {{ $document['payment_method'] }} | {{ number_format($document['tax_amount'], 2) }} | {{ number_format($document['tax_rate'], 2) }}% | {{ number_format($document['discount_amount'], 2) }} | {{ number_format($document['discount_rate'], 2) }}% | {{ number_format($document['total_paid_amount'], 2) }} | {{ number_format($document['edit_request_profit'], 2) }} | {{ number_format($document['total_profit'], 2) }} |
| No financial data found | ||||||||||||||||||||||||