@php $po = $preInvoice->purchaseOrder; $r = $po->purchaseRequest; $supplier = $po->supplier; $cr = $preInvoice->crReport; $companyName = config('procurement.company.legal_name', config('app.name')); $companyAddress = config('procurement.company.address'); $companyPhone = config('procurement.company.phone'); $taxCardNo = $preInvoice->tax_card_no ?? config('procurement.company.tax_card_no'); $deliveryAddress = $preInvoice->delivery_address ?? $r->delivery_location; $accountManager = $preInvoice->account_manager_name ?? $r->supplier_account_manager_name; $lines = $preInvoice->lines->isNotEmpty() ? $preInvoice->lines : collect([(object) [ 'line_no' => 1, 'description' => $cr->work_description, 'quantity' => 1, 'unit' => null, 'unit_price' => $preInvoice->subtotal, 'total' => $preInvoice->subtotal, ]]); @endphp
{{ $companyName }}
National Water Alliance
@if($companyAddress) {{ $companyAddress }}
@endif Tax Card N° : {{ $taxCardNo }} @if($companyPhone) — Tel : {{ $companyPhone }} @endif

PRE-INVOICE

{{ $preInvoice->reference }}

Issued : {{ optional($preInvoice->created_at)->format('d/m/Y') }}
@if($preInvoice->due_date) Due Date : {{ $preInvoice->due_date->format('d/m/Y') }} @endif
@if($deliveryAddress) @endif
PO Number {{ $po->po_number }} Request {{ $r->request_number }}
Supplier {{ $supplier->name }} Requester {{ $r->requester->name ?? '—' }}
Account Manager Name {{ $accountManager ?? '—' }} Currency {{ $preInvoice->currency->code }}
Delivery Address {{ $deliveryAddress }}

Pre-Invoice Detail

@foreach($lines as $line) @endforeach
# Description Qty Unit Unit Price Total
{{ $line->line_no }} {{ $line->description }} {{ rtrim(rtrim(number_format((float) $line->quantity, 4, '.', ''), '0'), '.') }} {{ $line->unit ?? '—' }} {{ number_format((float) $line->unit_price, 2, '.', ',') }} {{ number_format((float) $line->total, 2, '.', ',') }} {{ $preInvoice->currency->code }}
Sub-total{{ number_format((float) $preInvoice->subtotal, 2, '.', ',') }} {{ $preInvoice->currency->code }}
VAT ({{ $preInvoice->vat_rate }}%){{ number_format((float) $preInvoice->vat_amount, 2, '.', ',') }} {{ $preInvoice->currency->code }}
TOTAL{{ number_format((float) $preInvoice->total, 2, '.', ',') }} {{ $preInvoice->currency->code }}

Final Invoice Request

Please issue your final invoice referencing PO Number {{ $po->po_number }} and Pre-Invoice {{ $preInvoice->reference }}. @if($preInvoice->due_date) Payment due by {{ $preInvoice->due_date->format('d/m/Y') }}. @endif