@php $company ??= \App\Models\CompanySetting::current(); $bankingLines = $company->bankingDetailsLines($invoice->invoice_number); $legalIdentityLines = $company->legalIdentityLines(); $fallbackLogoPath = public_path('images/tarnova-logo.png'); $logoDataUri = $company->logoDataUri() ?: (file_exists($fallbackLogoPath) ? 'data:image/png;base64,'.base64_encode(file_get_contents($fallbackLogoPath)) : null); $documentTitle = $company->tax_vat_number ? 'Tax Invoice' : 'Invoice'; @endphp {{ $documentTitle }} {{ $invoice->invoice_number }}
@if ($logoDataUri) @else

{{ strtoupper($company->business_name) }}

@endif

@if ($company->email) {{ $company->email }} @endif @if ($company->phone) {{ $company->email ? ' - ' : '' }}{{ $company->phone }} @endif

@foreach ($legalIdentityLines as $line)

{{ $line['label'] }}: {{ $line['value'] }}

@endforeach

{{ $documentTitle }}

{{ $invoice->invoice_number }}

{{ $invoice->statusLabel() }}
Issue date {{ $invoice->issue_date->format('d M Y') }}
Due date {{ $invoice->due_date->format('d M Y') }}
VAT rate {{ number_format($invoice->tax_rate, 2) }}%
Amount due R {{ number_format($invoice->remainingBalance(), 2) }}
Bill to

{{ $invoice->client->name }}

@foreach ($invoice->client->documentDetails() as $detail)

{{ $detail['label'] }}: {{ $detail['value'] }}

@endforeach
From

{{ $company->business_name }}

@if ($company->email)

{{ $company->email }}

@endif @if ($company->phone)

{{ $company->phone }}

@endif @if ($company->address)

{!! nl2br(e($company->address)) !!}

@endif @foreach ($legalIdentityLines as $line)

{{ $line['label'] }}: {{ $line['value'] }}

@endforeach
@foreach ($invoice->items as $item) @endforeach
Description Qty Price Total
{{ $item->description }} {{ $item->quantity }} R {{ number_format($item->unit_price, 2) }} R {{ number_format($item->line_total, 2) }}
Payment note

Please use invoice {{ $invoice->invoice_number }} as the payment reference.

SubtotalR {{ number_format($invoice->subtotal, 2) }}
VATR {{ number_format($invoice->tax_total, 2) }}
@if ($invoice->totalCredited() > 0)
Credits- R {{ number_format($invoice->totalCredited(), 2) }}
Adjusted totalR {{ number_format($invoice->adjustedTotal(), 2) }}
@endif
Balance dueR {{ number_format($invoice->remainingBalance(), 2) }}
@if ($invoice->notes || $bankingLines !== []) @endif