@extends('customer.layouts.app') @section('title', 'Invoice ' . $invoice->invoice_number) @section('page-title', 'Invoice Details') @section('breadcrumbs') Invoices chevron_right {{ $invoice->invoice_number }} @endsection @section('header-actions') download Download PDF @endsection @section('content')

{{ $invoice->invoice_number }}

Issue Date: {{ $invoice->issue_date->format('M d, Y') }} Due Date: {{ $invoice->due_date->format('M d, Y') }}
@php $statusColors = [ 'draft' => 'bg-gray-100 text-gray-800', 'sent' => 'bg-blue-100 text-blue-800', 'viewed' => 'bg-purple-100 text-purple-800', 'partial' => 'bg-yellow-100 text-yellow-800', 'paid' => 'bg-green-100 text-green-800', 'overdue' => 'bg-red-100 text-red-800', ]; $status = $invoice->isOverdue() ? 'overdue' : $invoice->status; @endphp {{ ucfirst($status) }}

Billed To

{{ $invoice->customer->name }}

@if($invoice->customer->email)

{{ $invoice->customer->email }}

@endif @if($invoice->customer->address)

{{ $invoice->customer->address }}

@endif

Payment Summary

Total Amount: {{ $invoice->currency }} {{ number_format($invoice->total, 2) }}
Paid Amount: {{ $invoice->currency }} {{ number_format($invoice->paid_amount, 2) }}
Balance Due: {{ $invoice->currency }} {{ number_format($invoice->balance, 2) }}

Invoice Items

@foreach($invoice->items as $item) @endforeach @if($invoice->tax_amount > 0) @endif @if($invoice->discount_amount > 0) @endif
Description Quantity Unit Price Tax Rate Amount
{{ $item->description }} {{ number_format($item->quantity, 2) }} {{ $invoice->currency }} {{ number_format($item->unit_price, 2) }} {{ number_format($item->tax_rate, 2) }}% {{ $invoice->currency }} {{ number_format($item->total, 2) }}
Subtotal: {{ $invoice->currency }} {{ number_format($invoice->subtotal, 2) }}
Tax: {{ $invoice->currency }} {{ number_format($invoice->tax_amount, 2) }}
Discount: - {{ $invoice->currency }} {{ number_format($invoice->discount_amount, 2) }}
Total: {{ $invoice->currency }} {{ number_format($invoice->total, 2) }}
@if($invoice->payments->count() > 0)

Payment History

@foreach($invoice->payments as $payment) @endforeach
Payment # Date Method Amount Status
{{ $payment->payment_number }} {{ $payment->payment_date->format('M d, Y') }} {{ ucfirst(str_replace('_', ' ', $payment->payment_method)) }} {{ $payment->currency }} {{ number_format($payment->amount, 2) }} @php $statusColors = [ 'pending' => 'bg-yellow-100 text-yellow-700', 'completed' => 'bg-green-100 text-green-700', 'failed' => 'bg-red-100 text-red-700', 'refunded' => 'bg-gray-100 text-gray-700', ]; @endphp {{ ucfirst($payment->status) }}
@endif
@endsection