@include('templates.pdf_header', [ 'organisation' => $organisation, 'asOfDate' => $asOfDate, 'title' => 'PURCHAE ORDER REPORT' ])
@foreach($purchaseOrders as $po)

PO Number: {{ $po->po_number ?? $po->id }}

PO Date: {{ \Carbon\Carbon::parse($po->po_date)->format('F j, Y') }}

Supplier: {{ $po->supplier->name }}

Supplier Contact: {{ $po->supplier->email ?? 'N/A' }} / {{ $po->supplier->phone ?? 'N/A' }}

Currency: {{ $po->currency->code ?? 'N/A' }} | Exchange Rate: {{ $po->exchange_rate ?? 1 }}

@foreach($po->items as $index => $item) @endforeach
# Item Name Quantity Unit Price Total
{{ $index + 1 }} {{ $item->item_name }} {{ $item->quantity }} {{ number_format($item->unit_price, 2) }} {{ number_format($item->quantity * $item->unit_price, 2) }}

Total Amount: {{ number_format($po->total_amount, 2) }} {{ $po->currency->code ?? '' }}


@endforeach