@extends('layouts.app') @section('title', 'Final Receipt | ' . ($invoice->invoice_number ?? '')) @section('styles') @endsection @section('content')
@include('partials._document-header')

Final Receipt

Invoice: {{ $invoice->invoice_number }}
Date: {{ $invoice->created_at->format('d M Y') }}
Patient{{ $invoice->patient->full_name ?? '' }}
MRN{{ $invoice->patient->mrn ?? '' }}
{{-- All services --}} @foreach($invoice->items as $item) @endforeach
Service / Item Qty Price Total
{{ $item->description }} {{ $item->quantity }} {{ number_format($item->unit_price) }} {{ number_format($item->total) }}
TOTAL BILLED KES {{ number_format($invoice->total_amount ?? 0) }}
{{-- All payments --}}
Payments Received
@foreach($invoice->payments as $pay) @endforeach
Date Method Reference Amount
{{ $pay->created_at->format('d M H:i') }} {{ str_replace('_',' ',$pay->payment_method) }}{{ $pay->description ? ' ('.$pay->description.')' : '' }} {{ $pay->reference_number ?? $pay->mpesa_code ?? '-' }} KES {{ number_format($pay->amount) }}
TOTAL PAID KES {{ number_format($invoice->amount_paid ?? 0) }}
{{-- Balance --}} @php $bal = $invoice->balance ?? 0; @endphp

Balance Due

KES {{ number_format($bal) }}

Generated on {{ now()->format('d M Y H:i') }} by {{ Auth::user()->name ?? '' }}
@include('partials._document-footer', ['showPaybill' => true])
@endsection