<?php $__env->startSection('title',$type==='sales'?'Sales Returns':'Purchase Returns'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-head"><div><h1><?php echo e($type==='sales'?'Sales returns & credit notes':'Purchase returns'); ?></h1><p>Returns preserve the original document and reverse inventory, VAT, subledger, and accounting entries.</p></div><a href="<?php echo e($type==='sales'?route('sales.index'):route('purchases.index')); ?>" class="btn btn-light border btn-dense">Choose original document</a></div>
<div class="card-erp"><div class="table-responsive"><table class="table table-dense"><thead><tr><th>Return</th><th>Date</th><th>Original</th><th><?php echo e($type==='sales'?'Customer':'Supplier'); ?></th><th class="text-end">Taxable</th><th class="text-end">VAT</th><th class="text-end">Total</th><th>Status</th></tr></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $documents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td class="fw-bold text-accent"><?php echo e($doc->return_no); ?></td><td><?php echo e($doc->return_date->format('d M Y')); ?></td><td><?php echo e($type==='sales'?$doc->sale?->invoice_no:$doc->purchase?->purchase_no); ?></td><td><?php echo e($type==='sales'?$doc->customer?->name_en:$doc->supplier?->name_en); ?></td><td class="text-end"><?php echo e(number_format((float)$doc->taxable_total,2)); ?></td><td class="text-end"><?php echo e(number_format((float)$doc->vat_total,2)); ?></td><td class="text-end fw-bold"><?php echo e(number_format((float)$doc->grand_total,2)); ?></td><td><span class="badge status-<?php echo e($doc->status); ?>"><?php echo e(strtoupper($doc->status)); ?></span></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="8" class="text-center text-muted py-5">No returns have been posted.</td></tr><?php endif; ?></tbody></table></div><?php if($documents->hasPages()): ?><div class="card-erp-body border-top"><?php echo e($documents->links()); ?></div><?php endif; ?></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\saudi\resources\views\returns\index.blade.php ENDPATH**/ ?>