@extends('layouts.master') @section('content')

Home

{{ $rangeLabel }} ({{ $fromDate }} to {{ $toDate }})
{{-- CASH & LIQUIDITY (above the fold) --}}
Cash & Bank Balance
{{ number_format($cashAndBankBalance, 2) }}
Net Cash Position
{{ number_format($netCashPosition, 2) }}
Cash less supplier payments due (7 days)
Cash Flow This Month
{{ number_format($cashFlowDeltaThisMonth, 2) }}
In: {{ number_format($cashInflowsThisMonth, 2) }}   Out: {{ number_format($cashOutflowsThisMonth, 2) }}
Net Tax Liability (Range)
{{ number_format($netTaxLiability, 2) }}
Collected: {{ number_format($vatCollected, 2) }}   Paid: {{ number_format($vatPaid, 2) }}
Cash Flow Trend (Last 12 Months)
Bank Account Breakdown
Balances as at {{ $toDate }}
{{-- RECEIVABLES + PAYABLES --}}
Receivables
Outstanding
{{ number_format($totalOutstandingReceivables, 2) }}
Overdue
{{ number_format($overdueReceivables, 2) }}
Collected This Month
{{ number_format($collectedThisMonth, 2) }}
Payables
Outstanding
{{ number_format($totalOutstandingPayables, 2) }}
Overdue
{{ number_format($overduePayables, 2) }}
Paid This Month
{{ number_format($paidToSuppliersThisMonth, 2) }}
{{-- REVENUE & EXPENSES --}}
Revenue & Expenses
Revenue (Range)
{{ number_format($revenueThisRange, 2) }}
Expenses (Range)
{{ number_format($expensesThisRange, 2) }}
Gross Profit (Range)
{{ number_format($grossProfitThisRange, 2) }}
Net Profit / (Loss)
{{ number_format($netProfitThisRange, 2) }}
Expense Breakdown (Top Accounts)
{{-- DOCUMENT / TRANSACTION PIPELINE + ALERTS --}}
Document Pipeline
Open Quotations
{{ number_format($openQuotations) }}
Value: {{ number_format($openQuotationsValue, 2) }}
Open Sales Orders
{{ number_format($openSalesOrders) }}
Value: {{ number_format($openSalesOrdersValue, 2) }}
Unprocessed Invoices
{{ number_format($unprocessedInvoicesCount) }}
Pending POs
{{ number_format($pendingPurchaseOrders) }}
Pending GRVs
{{ number_format($pendingGrvs) }}
Funnel: Quotation → Sales Order → Invoice → Receipt
@php $maxFunnel = max(1, max($funnel)); @endphp @foreach($funnel as $label => $count)
{{ $label }}
{{ $count }}
@endforeach

Recent Documents
@forelse($recentDocuments as $doc) @empty @endforelse
Type Reference Customer / Supplier Date Status Total
{{ $doc['type'] }} {{ $doc['document_number'] }} @if($doc['side'] === 'customer') {{ $customerAccountNames[$doc['party_id']] ?? ('Customer #'.$doc['party_id']) }} @else {{ $supplierAccountNames[$doc['party_id']] ?? ('Supplier #'.$doc['party_id']) }} @endif {{ $doc['document_date'] }} {{ $doc['status'] }} {{ number_format((float) $doc['inclusive_total'], 2) }}
No recent documents found.
Alerts
Invoices overdue (30+ days)
@if($overdueInvoices30->isEmpty())
No overdue invoices.
@else
    @foreach($overdueInvoices30 as $inv)
  • {{ $customerAccountNames[$inv['customer_account_id']] ?? ('Customer #'.$inv['customer_account_id']) }} — {{ $inv['document_number'] }} ({{ number_format($inv['outstanding'], 2) }})
  • @endforeach
@endif
Quotations expiring (7 days)
@if($quotationsExpiring->isEmpty())
No expiring quotations.
@else
    @foreach($quotationsExpiring as $q)
  • {{ $q->document_number }} — {{ $customerAccountNames[$q->customer_account_id] ?? ('Customer #'.$q->customer_account_id) }}
  • @endforeach
@endif
Supplier payments due (7 days)
@if($supplierPaymentsDue->isEmpty())
No supplier payments due.
@else
    @foreach($supplierPaymentsDue as $p)
  • {{ $supplierAccountNames[$p['supplier_account_id']] ?? ('Supplier #'.$p['supplier_account_id']) }} — {{ $p['document_number'] }} ({{ number_format($p['outstanding'], 2) }})
  • @endforeach
@endif
Recent Activity
@if($activityLog->isEmpty())
No activity yet.
@else
    @foreach($activityLog as $a)
  • {{ \Carbon\Carbon::parse($a->created_at)->format('Y-m-d H:i') }} — {{ $a->user_name ?? 'System' }} {{ $a->action }} {{ $a->document_type }} #{{ $a->document_id }} ({{ $a->from_status ?? '-' }} → {{ $a->to_status }})
  • @endforeach
@endif
{{-- PERIOD COMPARISON --}}
Period Comparison
Metric This Month Last Month This Year Last Year
Revenue {{ number_format($periodSummary['this_month']['revenue'] ?? 0, 2) }} {{ number_format($periodSummary['last_month']['revenue'] ?? 0, 2) }} {{ number_format($periodSummary['this_year']['revenue'] ?? 0, 2) }} {{ number_format($periodSummary['last_year']['revenue'] ?? 0, 2) }}
Expenses {{ number_format($periodSummary['this_month']['expenses'] ?? 0, 2) }} {{ number_format($periodSummary['last_month']['expenses'] ?? 0, 2) }} {{ number_format($periodSummary['this_year']['expenses'] ?? 0, 2) }} {{ number_format($periodSummary['last_year']['expenses'] ?? 0, 2) }}
Net Profit {{ number_format($periodSummary['this_month']['net_profit'] ?? 0, 2) }} {{ number_format($periodSummary['last_month']['net_profit'] ?? 0, 2) }} {{ number_format($periodSummary['this_year']['net_profit'] ?? 0, 2) }} {{ number_format($periodSummary['last_year']['net_profit'] ?? 0, 2) }}
Receivables (Outstanding) {{ number_format($periodSummary['this_month']['receivables'] ?? 0, 2) }} {{ number_format($periodSummary['last_month']['receivables'] ?? 0, 2) }} {{ number_format($periodSummary['this_year']['receivables'] ?? 0, 2) }} {{ number_format($periodSummary['last_year']['receivables'] ?? 0, 2) }}
Payables (Outstanding) {{ number_format($periodSummary['this_month']['payables'] ?? 0, 2) }} {{ number_format($periodSummary['last_month']['payables'] ?? 0, 2) }} {{ number_format($periodSummary['this_year']['payables'] ?? 0, 2) }} {{ number_format($periodSummary['last_year']['payables'] ?? 0, 2) }}
@endsection @section('scripts') @endsection