<?php $__env->startSection('title', 'Customer Return'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-head"><div><h1 class="page-title">Customer Return</h1><div class="page-subtitle">Choose sold items carefully. The system now protects against over-return.</div></div></div>
<div class="card card-body">
    <form method="POST" action="<?php echo e(route('admin.sale-returns.store')); ?>"><?php echo csrf_field(); ?>
        <div class="row g-3 mb-3">
            <div class="col-md-3"><label>Customer Name</label><input class="form-control" name="customer_name" value="<?php echo e(old('customer_name')); ?>" required></div>
            <div class="col-md-3"><label>Phone</label><input class="form-control" name="customer_phone" value="<?php echo e(old('customer_phone')); ?>"></div>
            <div class="col-md-3"><label>Return Date</label><input class="form-control" type="date" name="return_date" value="<?php echo e(old('return_date', now()->toDateString())); ?>" required></div>
            <div class="col-md-3"><label>Refund Method</label><select class="form-select" name="refund_method"><option>Cash</option><option>Bank</option><option>Mobile Banking</option><option>Adjustment</option></select></div>
            <div class="col-12"><label>Address</label><input class="form-control" name="customer_address" value="<?php echo e(old('customer_address')); ?>"></div>
        </div>
        <div class="table-responsive"><table class="table table-bordered"><thead><tr><th>Sale Item</th><th>Qty Return</th><th>Restock</th></tr></thead><tbody><?php for($i=0;$i<5;$i++): ?><tr><td><select class="form-select" name="rows[<?php echo e($i); ?>][sale_id]"><option value="">Select Sale Item</option><?php $__currentLoopData = $sales; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sale): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($sale->id); ?>"><?php echo e($sale->invoice_no); ?> - <?php echo e($sale->product_name); ?> (Sold: <?php echo e($sale->quantity_sold); ?>)</option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></td><td><input class="form-control" type="number" min="1" name="rows[<?php echo e($i); ?>][qty]" value="<?php echo e($i===0 ? 1 : ''); ?>"></td><td><input type="hidden" name="rows[<?php echo e($i); ?>][restock]" value="0"><input class="form-check-input" type="checkbox" name="rows[<?php echo e($i); ?>][restock]" value="1" checked></td></tr><?php endfor; ?></tbody></table></div>
        <div><label>Notes</label><textarea class="form-control" rows="4" name="notes"><?php echo e(old('notes')); ?></textarea></div>
        <div class="mt-3"><button class="btn btn-primary">Save Return</button></div>
    </form>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH J:\xampp\htdocs\pos\resources\views/admin/returns/sale_form.blade.php ENDPATH**/ ?>