@extends('layouts.app') @section('title','Profit & Loss Summary') @section('styles')@endsection @section('content')
{{ $from->format('d M Y') }} — {{ $to->format('d M Y') }}
@php $exportType = 'profit-loss'; @endphp @include('reports._date-filter') @php // Two distinct net positions — both meaningful, different purposes. // Cash Net = Collections − Expenses Paid (pure cash-flow view) // Accrual Net = Invoiced − Expenses Paid (mixed; what the old card showed) $cashNet = $collections - $expensesPaid; $accrualNet = $revenue - $expensesPaid; @endphp {{-- ═══ HEADLINE CARDS ═══════════════════════════════════════════════ Four cards: Invoiced + Collections + Expenses Paid + Cash Net. Tooltips on each tile clarify the definition. --}}Invoiced
KES {{ number_format($revenue) }}
All invoices raised
Collections
KES {{ number_format($collections) }}
Completed payments
Expenses Paid
KES {{ number_format($expensesPaid) }}
Cash-out only
Cash Net
KES {{ number_format($cashNet) }}
Collections − Expenses Paid
Invoiced − Collections = KES {{ number_format($arGap) }}. This gap is money the hospital billed but hasn't yet collected — it sits in Accounts Receivable (patients owing balances + insurance claims pending settlement). See Open Balance report for the breakdown.
@if($accrualNet !== $cashNet)Accrual Net (Invoiced − Expenses Paid): KES {{ number_format($accrualNet) }} — this is the figure if you treat unbilled receivables as already-earned revenue. Cash Net (above) is the conservative measure based on cash actually in hand.
@endifBy invoice line department (pharmacy, lab, consultation, etc.)
| {{ $r->department ?: 'Other' }} | KES {{ number_format($r->total) }} |
| No invoiced revenue in window. | |
By recorded expense date (accrual basis)
| {{ $e->category }} | KES {{ number_format($e->total) }} |
| No expenses recorded in window. | |