@php use App\Support\DocumentBrand; /** @var \App\Support\InvoiceDocument $invoice */ $settings = $businessSettings ?? []; ['brand' => $brand, 'brandDark' => $brandDark, 'brandTint' => $brandTint] = DocumentBrand::colors($settings); $logoPath = DocumentBrand::logoPath($settings['business_logo'] ?? null); [$pillClass, $pillText] = $invoice->pill(); $showQty = collect($invoice->items)->contains(fn ($item) => filled($item['qty'] ?? null)); $showRate = collect($invoice->items)->contains(fn ($item) => filled($item['rate'] ?? null)); $descWidth = 100 - 6 - 24 - ($showQty ? 10 : 0) - ($showRate ? 20 : 0); @endphp Invoice {{ $invoice->number }} @include('documents._styles', ['brand' => $brand, 'brandDark' => $brandDark, 'brandTint' => $brandTint])
 
{{-- Masthead: who is billing, and what this document is ----------------- --}}
@if ($logoPath) @endif @if (!empty($settings['business_name']))

{{ $settings['business_name'] }}

@endif @if (!empty($settings['business_address']))

{{ $settings['business_address'] }}

@endif @if (!empty($settings['business_phone']) || !empty($settings['business_email']))

{{ implode(' · ', array_filter([$settings['business_phone'] ?? null, $settings['business_email'] ?? null])) }}

@endif

{{ $invoice->title }}

{{ $invoice->number }}

{{ $pillText }}

{{-- Headline figures ----------------------------------------------------- --}}
@foreach ($invoice->strip as [$label, $value]) @endforeach

{{ strtoupper($label) }}

{{ $value }}

{{-- Billed to / what the invoice is for -------------------------------- --}}

{{ $invoice->partyLabel }}

{{ $invoice->partyName }}

@foreach ($invoice->partyLines as $line)

{{ $line }}

@endforeach

DETAILS

@foreach ($invoice->facts as $label => $value) @endforeach
{{ $label }} {{ $value }}
{{-- Line items ---------------------------------------------------------- --}} @if ($showQty) @endif @if ($showRate) @endif @foreach ($invoice->items as $item) @if ($showQty) @endif @if ($showRate) @endif @endforeach
# DESCRIPTIONQTYRATEAMOUNT
{{ str_pad((string) $loop->iteration, 2, '0', STR_PAD_LEFT) }}

{{ $item['title'] }}

@if (filled($item['details'] ?? null))

{!! nl2br(e($item['details'])) !!}

@endif @if (filled($item['meta'] ?? null))

{{ $item['meta'] }}

@endif
{{ $item['qty'] ?? '' }}{{ $item['rate'] ?? '' }}{{ $item['amount'] }}
{{-- Totals -------------------------------------------------------------- --}}

IN WORDS
{{ DocumentBrand::amountInWords($invoice->total, $invoice->currency) }}

{{ $invoice->noteTitle }} {{ $invoice->noteText }}
@foreach ($invoice->totals as $row) @endforeach
{{ $row['label'] }} {{ $row['value'] }}
BALANCE DUE {{ $invoice->money($invoice->due) }}
{{-- Money already received --------------------------------------------- --}} @if ($invoice->payments)

PAYMENTS RECEIVED

@foreach ($invoice->payments as $payment) @endforeach
DATE METHOD REFERENCE AMOUNT
{{ $payment['date'] }} {{ $payment['method'] }} {{ $payment['reference'] }} {{ $payment['amount'] }}
@endif {{-- Travellers, payment terms and the like ------------------------------ --}} @foreach ($invoice->tables as $table)

{{ $table['heading'] }}

@if ($table['headers']) @foreach ($table['headers'] as $header) @endforeach @endif @foreach ($table['rows'] as $row) @foreach ($row as $cell) {{-- A headerless table is label/value pairs. --}} @endforeach @endforeach
{{ $header }}
!$table['headers'] && $loop->first, 'b' => !$table['headers'] && !$loop->first]) @if (!$table['headers'] && $loop->first) style="width: 34%;" @endif>{{ $cell }}
@endforeach {{-- Notes, terms, policies ---------------------------------------------- --}} @foreach ($invoice->blocks as $block)

{{ $block['heading'] }}

{!! nl2br(e($block['text'])) !!}

@endforeach
Thank you for choosing {{ $settings['business_name'] ?? 'us' }}.
This invoice was generated electronically and is valid without a signature. Please quote {{ $invoice->reference }} in any correspondence. @if ($invoice->footnote) {{ $invoice->footnote }} @endif @if (!empty($settings['business_email']) || !empty($settings['business_phone']))
{{ implode(' · ', array_filter([$settings['business_email'] ?? null, $settings['business_phone'] ?? null])) }} @endif