@php $money = fn ($value) => 'R '.number_format((float) $value, 2); $totalPaid = $invoice->totalPaid(); $totalCredited = $invoice->totalCredited(); $adjustedTotal = $invoice->adjustedTotal(); $balance = $invoice->remainingBalance(); $canPayOnline = $invoice->isCollectible(); $paymentProgress = $adjustedTotal > 0 ? min(100, round(($totalPaid / $adjustedTotal) * 100)) : 100; $company = $company ?? \App\Models\CompanySetting::current(); $documentTitle = $company->tax_vat_number ? 'Tax Invoice' : 'Invoice'; @endphp

Secure {{ strtolower($documentTitle) }}

{{ $invoice->invoice_number }}

{{ $invoice->client->name }} · Due {{ $invoice->due_date->format('d M Y') }}

{{ $invoice->statusLabel() }}

Balance due

{{ $money($balance) }}

@if ($adjustedTotal > 0)

{{ $paymentProgress }}% paid.

@else

Settled by credits.

@endif
@if ($canPayOnline) Pay Now @else Payment not required @endif

Original invoice total

{{ $money($invoice->grand_total) }}

Credits applied

{{ $money($totalCredited) }}

Amount paid

{{ $money($totalPaid) }}

Payment status

{{ $balance <= 0.01 ? 'Paid in full' : ($totalPaid > 0 ? 'Partially paid' : 'Awaiting payment') }}

@foreach ($invoice->items as $item) @endforeach
DescriptionQtyPriceTotal
{{ $item->description }}{{ $item->quantity }}{{ $money($item->unit_price) }}{{ $money($item->line_total) }}
@if ($invoice->notes)

Notes

{{ $invoice->notes }}

@else
No invoice notes.
@endif

Invoice summary

Subtotal before VAT{{ $money($invoice->subtotal) }}
VAT ({{ number_format((float) $invoice->tax_rate, 2) }}%){{ $money($invoice->tax_total) }}
@if ($totalCredited > 0)
Credits applied- {{ $money($totalCredited) }}
@endif @if ($totalPaid > 0)
Amount paid- {{ $money($totalPaid) }}
@endif
Balance due{{ $money($balance) }}