@include('pos.supplier._purchasing_nav')

Create Purchase Return

Back to Returns
@csrf
@error('bill_id')
{{ $message }}
@enderror
Only RECEIVED purchases are listed.
@error('info')
{{ $message }}
@enderror

Return Items

Enter quantities to return. Quantity must be ≤ purchased minus already returned.

@error('lines')
{{ $message }}
@enderror
@foreach($billItems as $it) @php $maxQty = (float) ($it->available_qty ?? ((float) ($it->supp_bill_qty ?? 0) - (float) ($it->supp_bill_return_qty ?? 0))); @endphp
@php $p = $it->product; $productName = $p?->name ?? $p?->product_name ?? $it->product_name ?? null; $productLocalName = $p?->name_local ?? $p?->name_si ?? $p?->nameSinhala ?? null; $productBarcode = $p?->barcode ?? null; $productName = is_string($productName) ? trim($productName) : $productName; $productLocalName = is_string($productLocalName) ? trim($productLocalName) : $productLocalName; @endphp
{{ $productName ?: ('Product ID: ' . $it->supp_bill_product_id) }} @if(!empty($productBarcode)) (Barcode: {{ $productBarcode }}) @endif
@if(!empty($productLocalName) && $productLocalName !== $productName)
{{ $productLocalName }}
@endif
Batch: {{ $it->badge?->price_name ?? $it->supp_bill_badge_id }} | Remaining: {{ number_format($maxQty, 3) }}
@endforeach @if(count($billItems) === 0)
Select a purchase to load bill items, then enter return quantities.
@endif
Cancel