@extends('layouts.app') @section('heading', 'Return or exchange') @section('subheading', 'Exchanges within '.$exchangeWindow.' days. Refunds are '.($refundsAllowed ? 'allowed' : 'off unless a manager approves').'.') @section('content')
With receipt

Open the original sale by invoice number.

No receipt — scan item

Customer lost the slip? Scan the barcode / SKU on the garment to find returnable sales for that item.

@if(!empty($matches) && $matches->isNotEmpty())
Returnable sales for this item

Pick the sale this item came from, then return that individual line.

@foreach($matches as $row) @php $item = $row['sale_item']; @endphp
{{ $item->sale->number }}
{{ $item->sale->created_at->format('d M Y') }} · {{ $item->sale->customer->name ?? 'Walk-in' }} · {{ $item->description }} · {{ $row['left'] }} left to return · {{ money($item->line_total) }}
Return this item
@endforeach
@elseif(filled($barcode ?? null) && empty($sale))
No returnable sales found for “{{ $barcode }}” at this store.
@endif @if($sale)
@csrf

{{ $sale->number }} · {{ $sale->created_at->format('d M Y') }} · {{ $sale->customer->name ?? 'Walk-in' }} · {{ money($sale->total) }}

@foreach($sale->items as $item) @php $left = $item->qty - (int) ($held[$item->id] ?? 0); $defaultQty = (!empty($preselect) && (int) $preselect === (int) $item->id && $left > 0) ? 1 : 0; @endphp
{{ $item->description }}
{{ $left }} available to return · paid {{ money($item->line_total) }}@if($item->variant?->sku) · {{ $item->variant->sku }}@endif
@endforeach
@include('partials.manager')
@endif @endsection