@extends('layouts.app') @section('title', 'Invoice #' . $invoice->invoice_number) @section('content')

Invoice #{{ $invoice->invoice_number }}

{{ str_replace('_', ' ', $invoice->payment_status) }}

Generated on {{ $invoice->invoice_date->format('d M Y, h:i A') }} • Billing Category: {{ strtoupper($invoice->billing_type) }}

{{ substr($invoice->patient->first_name, 0, 1) }}{{ substr($invoice->patient->last_name, 0, 1) }}

{{ $invoice->patient->full_name }}

{{ $invoice->patient->patient_id }} UHID: {{ $invoice->patient->uhid }}
{{ $invoice->patient->age_formatted }} • {{ ucfirst($invoice->patient->gender) }} • Mobile: {{ $invoice->patient->mobile }}
{!! $barcodeSvg !!}
Itemized Services & Charges
@foreach($invoice->items as $idx => $item) @endforeach
# Item Description Category Qty Unit Rate (₹) Tax (₹) Line Total (₹)
{{ $idx + 1 }} {{ $item->item_name }} {{ $item->item_category }} {{ $item->quantity }} ₹{{ number_format($item->unit_price, 2) }} ₹{{ number_format($item->tax_amount, 2) }} ₹{{ number_format($item->total_amount, 2) }}
@if($invoice->notes) Notes: {{ $invoice->notes }} @endif
Subtotal: ₹{{ number_format($invoice->subtotal_amount, 2) }}
@if($invoice->discount_amount > 0)
Discount: -₹{{ number_format($invoice->discount_amount, 2) }}
@endif
Tax / GST: ₹{{ number_format($invoice->tax_amount, 2) }}
Grand Total: ₹{{ number_format($invoice->grand_total, 2) }}
Total Paid: ₹{{ number_format($invoice->paid_amount, 2) }}
Balance Due: ₹{{ number_format($invoice->balance_due, 2) }}
@if($invoice->balance_due > 0)
Collect Payment Due: ₹{{ number_format($invoice->balance_due, 2) }}
@csrf
@else

Invoice Fully Settled

Zero balance remaining. All dues have been collected.

@endif
Payment Receipts Ledger {{ $invoice->payments->count() }} receipts
@forelse($invoice->payments as $pay)
{{ $pay->payment_number }}
{{ $pay->payment_date->format('d/m/Y h:i A') }} • Mode: {{ $pay->payment_method }}
@if($pay->transaction_reference)
Ref: {{ $pay->transaction_reference }}
@endif
₹{{ number_format($pay->amount, 2) }}
Cashier: {{ $pay->cashier->name ?? 'Staff' }}
@empty
No payments recorded against this invoice yet.
@endforelse
@endsection