@php $productOptions = $products->map(fn ($product) => (object) ['id' => $product->id, 'name' => "{$product->name} ({$product->sku})"]); @endphp
← Back to sales
@if (session('error'))
{{ session('error') }}
@endif @if ($quotationId)
Converting a quotation into this sale — review pricing, stock and batches before saving.
@endif

Details

@if ($users->isNotEmpty())
@endif

% off each product's MRP — GST is already included in that figure, not added again on top.

Items

{{-- Deliberately not wrapped in overflow-x-auto: the per-row product picker below is an absolutely-positioned dropdown, and any ancestor with overflow-x set to anything but visible clips it (per the CSS spec, setting overflow-x forces overflow-y to auto too, even though only -x was set) - the dropdown was rendering cut off/cramped inside that container. This table's columns are narrow enough not to need horizontal scroll; if that changes, the picker needs to escape via a portal instead of restoring this. --}}
@foreach ($items as $index => $item) @endforeach
Product Quantity Unit Price Tax % Line Total
@if ($item['product_id'] && $warehouseId) @php $product = $products->firstWhere('id', (int) $item['product_id']) @endphp @if ($product?->track_batches) @else

In stock: {{ $this->availableStock($index) }}

@endif @endif
{{ number_format((float) ($item['quantity'] ?: 0) * (float) ($item['unit_price'] ?: 0), 2) }} @if (count($items) > 1) @endif
Subtotal {{ number_format($this->subtotal(), 2) }}
@if ($this->discountAmount() > 0)
Discount ({{ rtrim(rtrim(number_format((float) $discountPercent, 2), '0'), '.') }}%) -{{ number_format($this->discountAmount(), 2) }}
@endif
Tax {{ number_format($this->taxTotal(), 2) }}
Total {{ number_format($this->grandTotal(), 2) }}
@if ($this->sampleQuantity() > 0)
Samples (not charged) {{ $this->sampleQuantity() }} pcs
@endif
Est. COGS (incl. GST) {{ number_format($this->estimatedCost(), 2) }}
Est. Profit (incl. GST) {{ number_format($this->estimatedProfit(), 2) }}

Samples (optional)

Products given to the customer free of charge. They are deducted from stock but not billed: no price or tax, and they don't count towards schemes.

@if ($samples) @foreach ($samples as $index => $sample) @endforeach
Product Quantity
@if ($sample['product_id'] && $warehouseId) @php $sampleProduct = $products->firstWhere('id', (int) $sample['product_id']) @endphp @if ($sampleProduct?->track_batches) @else

In stock: {{ $this->sampleStock($index) }}

@endif @endif
@endif
Cancel