← Back to purchases
@if ($savedPurchaseOrderId)
Purchase order {{ $savedPurchaseOrderNumber }} saved. The Excel file has been downloaded. Open the order · Edit it
@endif

Smart order

Pick the items you need and say roughly what you want to spend. Quantities are allocated in full boxes and stay editable before anything is saved.

Items @if (count($selected)) {{ count($selected) }} selected @endif

@if (count($selected)) @endif
@if (count($selected))
@foreach ($selected as $id) @php $product = $this->productMap()->get((int) $id); @endphp @continue(! $product) {{ $product->name }} @endforeach
@endif @php $minimum = $this->selectionMinimum(); $targetFloat = (float) $targetAmount; $minVariancePct = $targetFloat > 0 ? (($minimum['total'] - $targetFloat) / $targetFloat * 100) : null; @endphp @if ($minimum['count'] > 0 && $targetFloat > 0)
$minVariancePct > 0 && $minVariancePct <= 50, 'bg-red-50 dark:bg-red-500/10 text-red-700 dark:text-red-300' => $minVariancePct > 50, 'bg-gray-50 dark:bg-gray-900/40 text-gray-500 dark:text-gray-400' => $minVariancePct <= 0, ])> @if ($minVariancePct > 0) Minimum possible spend for {{ $minimum['count'] }} item{{ $minimum['count'] === 1 ? '' : 's' }} — one box each — is ₹{{ number_format($minimum['total'], 2) }}, already {{ number_format($minVariancePct, 0) }}% over your ₹{{ number_format($targetFloat, 2) }} target. Deselect a few items or raise the target before building the order. @else Minimum for {{ $minimum['count'] }} item{{ $minimum['count'] === 1 ? '' : 's' }} — one box each — is ₹{{ number_format($minimum['total'], 2) }}, within your ₹{{ number_format($targetFloat, 2) }} target. @endif
@endif
@if ($planned) @endif
@if ($this->pricedLines()) @php $totals = $this->totals(); @endphp

Preview — edit any quantity

@if ($totals['target'] > 0)

abs($totals['variance_pct']) <= 2, 'text-amber-600 dark:text-amber-400' => abs($totals['variance_pct']) > 2, ])> {{ $totals['variance'] >= 0 ? '+' : '−' }}₹{{ number_format(abs($totals['variance']), 2) }} ({{ number_format(abs($totals['variance_pct']), 2) }}%) against target

@endif
@foreach ($this->pricedLines() as $index => $line) @endforeach
Product Box GST Rate Boxes Quantity Value
{{ $line['name'] }}
{{ $line['sku'] }}
{{ $line['box_quantity'] ?: '—' }} {{ rtrim(rtrim(number_format($line['gst_rate'], 2), '0'), '.') }}% {{ number_format($line['rate'], 2) }} $line['whole_boxes'], 'text-amber-600 dark:text-amber-400 font-medium' => ! $line['whole_boxes'], ]) title="{{ $line['whole_boxes'] ? '' : 'Not a whole number of boxes' }}"> {{ $line['whole_boxes'] ? (int) $line['boxes'] : number_format($line['boxes'], 2) }}
{{ number_format($line['inclusive_total'], 2) }}
Total quantity
{{ $totals['quantity'] }} PCS
Taxable value
{{ number_format($totals['taxable'], 2) }}
GST
{{ number_format($totals['tax_total'], 2) }}
@if ($totals['target'] > 0)
Target
{{ number_format($totals['target'], 2) }}
@endif
Order total
₹{{ number_format($totals['total'], 2) }}

Saves the purchase order and downloads the sheet. You can edit it afterwards.

@endif