@extends('admin.layouts.app') @section('title', __('Invoice Details')) @section('breadcrumb') @endsection @section('content')
{{ __('Invoice') }} #{{ $invoice->invoice_no }} {{ ucfirst($invoice->status ?? 'draft') }}
@if($invoice->status === 'draft') {{ __('Edit') }} @endif {{ __('Print') }}
{{ __('Invoice Information') }}
{{ __('Invoice Number') }}
{{ $invoice->invoice_no }}
{{ __('Date') }}
{{ $invoice->invoice_date?->format('M d, Y') }}
{{ __('Due Date') }}
{{ $invoice->due_date?->format('M d, Y') }}
{{ __('Status') }}
{{ ucfirst($invoice->status ?? 'draft') }}
{{ __('Patient Information') }}
{{ __('Name') }}
{{ $invoice->patient?->name }}
{{ __('Phone') }}
{{ $invoice->patient?->phone }}
{{ __('Email') }}
{{ $invoice->patient?->email }}
{{ __('Address') }}
{{ $invoice->patient?->address ?? __('N/A') }}

{{ __('Invoice Items') }}
@forelse($invoice->items ?? [] as $item) @empty @endforelse
{{ __('Description') }} {{ __('Quantity') }} {{ __('Unit Price') }} {{ __('Amount') }}
{{ $item->description }} {{ $item->quantity }} ${{ number_format($item->unit_price ?? 0, 2) }} ${{ number_format(($item->quantity ?? 1) * ($item->unit_price ?? 0), 2) }}
{{ __('No items') }}
{{ __('Subtotal') }} ${{ number_format($invoice->subtotal ?? 0, 2) }}
{{ __('Tax') }} ({{ $invoice->tax_rate ?? 0 }}%) ${{ number_format($invoice->tax_amount ?? 0, 2) }}
{{ __('Total') }} ${{ number_format($invoice->total ?? 0, 2) }}
@if($invoice->description)
{{ __('Notes') }}

{{ $invoice->description }}

@endif
@if($invoice->payments && $invoice->payments->count() > 0)
{{ __('Payments Received') }}
@foreach($invoice->payments as $payment) @endforeach
{{ __('Date') }} {{ __('Amount') }} {{ __('Method') }} {{ __('Reference') }}
{{ $payment->created_at?->format('M d, Y') }} ${{ number_format($payment->amount, 2) }} {{ ucfirst($payment->method ?? 'cash') }} {{ $payment->reference ?? __('N/A') }}
@endif
{{ __('Invoice Status') }}
{{ __('Current Status') }}
{{ ucfirst($invoice->status ?? 'draft') }}

{{ __('Amount Due') }}
${{ number_format(($invoice->total ?? 0) - ($invoice->payments?->sum('amount') ?? 0), 2) }}
{{ __('Payment Status') }}
@php $paid = $invoice->payments?->sum('amount') ?? 0; $total = $invoice->total ?? 0; $percentage = $total > 0 ? ($paid / $total) * 100 : 0; @endphp
{{ number_format($percentage, 1) }}% {{ __('paid') }}
{{ __('Actions') }}
@if($invoice->status === 'draft') {{ __('Edit Invoice') }}
@csrf
@endif @if($invoice->status !== 'paid') @endif {{ __('Print') }} {{ __('Back to Billing') }}
@endsection @push('scripts') @endpush