@php $company = $setting?->company_name ?: config('app.name'); $primary = $setting?->primary_color ?: '#124a61'; $symbol = $symbol ?? ''; $code = $invoice->currency_code ?: ''; $money = function ($value) use ($symbol, $code) { $formatted = number_format((float) $value, 2); return ($symbol !== '' ? $symbol . ' ' : ($code !== '' ? $code . ' ' : '')) . $formatted; }; $hasBalance = (float) $invoice->balance_due > 0.01 && ! in_array($invoice->status, ['VOID', 'PAID'], true); $isPaid = ! $hasBalance && $invoice->status !== 'VOID'; $items = $invoice->lineItems ?? collect(); @endphp

Dear {{ $invoice->payerName() ?: 'Customer' }},

Please find invoice {{ $invoice->invoice_number }} from {{ $company }} below. A PDF copy is attached for your records.

@if ((float) $invoice->amount_paid > 0) @endif
Total {{ $money($invoice->total) }}
Amount Paid {{ $money($invoice->amount_paid) }}
{{ $isPaid ? 'Balance' : 'Balance Due' }} {{ $money($invoice->balance_due) }}
Due Date {{ optional($invoice->due_date)->format('F j, Y') ?: '—' }}
@if ($isPaid)
✓ Paid in Full
@endif
@if ($items->isNotEmpty())

Items

@foreach ($items as $line) @endforeach
•  {{ $line->name }} @if ((float) $line->qty > 0) × {{ rtrim(rtrim(number_format((float) $line->qty, 2), '0'), '.') }} @endif {{ $money($line->line_total) }}
@endif @if ($hasBalance)
Pay {{ $money($invoice->balance_due) }}

@if ($canPayOnline) Prefer to review first? View the full invoice online. @else View the invoice and payment details online. @endif

@else

This invoice is fully paid, thank you!

View invoice online

@endif