← Back to purchase orders
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @php $balanceDue = $purchaseOrder->balanceDue(); @endphp {{ str($purchaseOrder->status)->replace('_', ' ')->title() }} Print / PDF Download Excel @can('purchases.update') @if (($purchaseOrder->status === 'open' && $purchaseOrder->goodsReceipts->isEmpty()) || ($purchaseOrder->status !== 'cancelled' && auth()->user()->isAdmin())) Edit @endif @endcan @can('purchases.return') @if ($purchaseOrder->items->contains(fn ($item) => $item->returnableQuantity() > 0)) @endif @endcan @can('purchases.cancel') @if ($purchaseOrder->isCancellable()) @endif @endcan @can('purchases.update') @endcan @can('purchases.receive') @if ($purchaseOrder->isCancellable()) @endif @endcan @if ($purchaseOrder->notes)

{{ $purchaseOrder->notes }}

@endif

Items

@foreach ($purchaseOrder->items as $item) $item->importDiscrepancy()])> @endforeach
# Product Ordered Received Pending Unit Cost Line Total GST Total incl. GST
{{ $loop->iteration }} {{ $item->product?->name ?? "Deleted product (#{$item->product_id})" }} @if ($item->received_quantity > 0 && $purchaseOrder->status !== 'cancelled') @can('purchases.update') @endcan @endif @if ($item->importDiscrepancy()) ⚠
{{ implode('; ', $item->importDiscrepancy()) }}
@endif
{{ $item->ordered_quantity }} {{ $item->received_quantity }} $item->pendingQuantity() > 0, 'text-gray-400 dark:text-gray-500' => $item->pendingQuantity() === 0, ])> {{ $item->pendingQuantity() }} {{ number_format($item->unit_cost, 2) }} {{ number_format($item->line_total, 2) }} {{ number_format($lineGst, 2) }}
{{ rtrim(rtrim(number_format((float) $item->tax_rate, 2), '0'), '.') }}%
{{ number_format((float) $item->line_total + $lineGst, 2) }}
{{ number_format(((float) $item->line_total + $lineGst) / max(1, (int) $item->ordered_quantity), 2) }} per pc
Total · {{ $purchaseOrder->items->count() }} items {{ number_format($purchaseOrder->items->sum('ordered_quantity')) }} {{ number_format($purchaseOrder->items->sum('received_quantity')) }} {{ number_format($purchaseOrder->items->sum(fn ($item) => $item->pendingQuantity())) }}
@if ($purchaseOrder->status !== 'cancelled') @endif

Receiving History

@if ($purchaseOrder->goodsReceipts->isEmpty()) @else
@foreach ($purchaseOrder->goodsReceipts as $receipt)
{{ $receipt->receipt_number }}
{{ $receipt->received_date->format('d M Y') }} · {{ $receipt->createdBy?->name ?? '—' }} @if ($receipt->isCancelled()) Cancelled @elseif (! $receipt->isBilled() && auth()->user()->can('purchases.cancel')) @endif
@if ($receipt->supplier_bill_number || $receipt->supplier_bill_date || $receipt->due_date)
@if ($receipt->supplier_bill_number) Bill: {{ $receipt->supplier_bill_number }} @endif @if ($receipt->supplier_bill_date) Billed {{ $receipt->supplier_bill_date->format('d M Y') }} @endif @if ($receipt->due_date) $receipt->isOverdue(), 'bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300' => ! $receipt->isOverdue(), ])> {{ $receipt->isOverdue() ? 'Overdue since' : 'Due' }} {{ $receipt->due_date->format('d M Y') }} @endif
@endif
    @foreach ($receipt->items as $line)
  • {{ $line->product?->name ?? "Deleted product (#{$line->product_id})" }} — {{ $line->received_quantity }} @ {{ number_format($line->unit_cost, 2) }}
  • @endforeach
@endforeach
@endif
@if ($purchaseOrder->payments->isNotEmpty() || $purchaseOrder->creditAllocations->isNotEmpty() || $purchaseOrder->returnAllocations->isNotEmpty())

Payments

@foreach ($purchaseOrder->payments as $payment)
{{ number_format($payment->amount, 2) }} · {{ $payment->payment_date->format('d M Y') }} @if ($payment->method) · {{ str($payment->method)->replace('_', ' ')->title() }} @endif @if ($payment->reference_number) · Ref: {{ $payment->reference_number }} @endif
@can('purchases.cancel') @endcan
@endforeach @foreach ($purchaseOrder->creditAllocations as $allocation)
{{ number_format($allocation->amount, 2) }} · {{ $allocation->applied_date->format('d M Y') }} · Settled from credit note #{{ $allocation->supplier_credit_note_id }}@if ($allocation->creditNote?->reason) ({{ $allocation->creditNote->reason }})@endif
@endforeach @foreach ($purchaseOrder->returnAllocations as $allocation)
{{ number_format($allocation->amount, 2) }} · {{ $allocation->applied_date->format('d M Y') }} · Settled from returned stock {{ $allocation->returnable?->return_number }}
@endforeach
@endif @if ($purchaseOrder->returns->isNotEmpty())

Returns to Supplier

@foreach ($purchaseOrder->returns as $return)
{{ $return->return_number }} {{ $return->return_date->format('d M Y') }} · {{ number_format($return->total, 2) }}
    @foreach ($return->items as $line)
  • {{ $line->product?->name ?? "Deleted product (#{$line->product_id})" }} — {{ $line->quantity }} @ {{ number_format($line->unit_cost, 2) }}
  • @endforeach
@endforeach
@endif {{-- Record Payment modal --}} @if ($showPaymentForm)

Record Payment

Balance due on {{ $purchaseOrder->po_number }}: {{ number_format($purchaseOrder->balanceDue(), 2) }}

@php($pendingNotes = $this->pendingCreditNotes()) @if ($pendingNotes->isNotEmpty())
Pending credit notes from this supplier

Tick to settle this order with them (only up to what it still owes). Notes already used are not listed.

@foreach ($pendingNotes as $note) @endforeach
@endif @php($pendingReturns = $this->pendingReturns()) @if ($pendingReturns->isNotEmpty())
Returned stock (debit notes) not yet adjusted

Tick to deduct the value of stock you sent back from this payment (only up to what this order still owes).

@foreach ($pendingReturns as $ret) @endforeach
@endif
@endif {{-- Edit Payment modal --}} @if ($editingPaymentId)

Edit Payment

@endif {{-- Return to Supplier modal --}} @if ($showReturnForm)

Return to Supplier

@foreach ($returnLines as $index => $line)
{{ $line['product_name'] }} Returnable: {{ $line['returnable'] }}
@if ($line['track_batches']) @endif
@endforeach
@endif {{-- Receive Goods modal --}} @if ($showReceiveForm)

Receive Goods

@foreach ($receiveLines as $index => $line)
{{ $line['product_name'] }} Pending: {{ $line['pending'] }}
@if ($line['track_batches'])
@endif
@endforeach

Supplier Bill (optional)

@endif {{-- Change the product of a received line --}} @if ($changeItemId) @php($changeItem = $purchaseOrder->items->firstWhere('id', $changeItemId))

Change product on this line

Now: {{ $changeItem?->product?->name }}, {{ $changeItem?->received_quantity }} received at {{ number_format((float) $changeItem?->unit_cost, 2) }}.

Stock is corrected with two adjustments that stay in the product history: {{ $changeItem?->received_quantity }} come off {{ $changeItem?->product?->name }} and go onto the product you choose, at {{ number_format((float) $changeItem?->unit_cost, 2) }}. Quantity, cost and tax on the line do not change. It is refused if the current product no longer has that much in stock.
@endif