@extends('layouts.app') @section('title', 'Invoice Details') @section('content')
@if($invoice->status !== 'paid') @endif Apply Credit
@if($invoice->quote || $invoice->salesOrder)
Generated from: @if($invoice->salesOrder) {{ $invoice->salesOrder->order_number }} @endif @if($invoice->quote) {{ $invoice->quote->quote_number }} @endif
@endif

ACCOUNTIFY

Your Trusted Accounting Partner

INVOICE

{{ $invoice->invoice_number }}

BILL TO

{{ $invoice->customer->name }}
@if($invoice->customer->company_name)

{{ $invoice->customer->company_name }}

@endif
{!! nl2br(e($invoice->customer->billing_address)) !!}
@if($invoice->customer->phone)

Phone: {{ $invoice->customer->phone }}

@endif
INVOICE DATE: {{ \Carbon\Carbon::parse($invoice->invoice_date)->format('d M Y') }}
DUE DATE: {{ \Carbon\Carbon::parse($invoice->due_date)->format('d M Y') }}
STATUS: @php $statusClass = [ 'unpaid' => 'bg-danger text-white', 'partial' => 'bg-warning text-dark', 'paid' => 'bg-success text-white', 'void' => 'bg-secondary text-white', ][$invoice->status] ?? 'bg-light text-muted'; @endphp {{ $invoice->status }}
@foreach($invoice->items as $item) @endforeach
Item & Description Qty Rate Amount
{{ $item->item_name }} {{ number_format($item->quantity, 2) }} {{ formatCurrency($item->rate) }} {{ formatCurrency($item->amount) }}
@if($invoice->notes)
NOTES

{!! nl2br(e($invoice->notes)) !!}

@endif
SUB TOTAL {{ formatCurrency($invoice->subtotal) }}
@if($invoice->tax_id && $invoice->taxDetails)
{{ $invoice->taxDetails->name }} ({{ $invoice->taxDetails->rate }}%) {{ formatCurrency($invoice->tax_amount) }}
@elseif($invoice->tax_amount > 0)
TAX {{ formatCurrency($invoice->tax_amount) }}
@endif
TOTAL {{ formatCurrency($invoice->total_amount) }}

Thank you for choosing Accountify. Please process your payment by the due date.

{{-- Payment History --}} @if($invoice->payments->count())
Payment History
{{ $invoice->payments->count() }} payment(s)
@foreach($invoice->payments as $payment) @endforeach @if($invoice->pending_amount > 0) @endif
Payment # Date Mode Reference Amount
{{ $payment->payment_number }} {{ \Carbon\Carbon::parse($payment->payment_date)->format('d M Y') }} {{ $payment->payment_mode }} {{ $payment->reference_number ?? '—' }} {{ formatCurrency($payment->amount) }}
Total Paid: {{ formatCurrency($invoice->paid_amount) }}
Pending Balance: {{ formatCurrency($invoice->pending_amount) }}
@endif {{-- Record Payment Modal --}} @if($invoice->status !== 'paid') @endif @endsection