<?php $__env->startSection('title', __('nav.sales_history')); ?>
<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-between mb-3">
    <h1 class="h4 mb-0"><?php echo e(__('nav.sales_history')); ?></h1>
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('sales.create')): ?><a class="btn btn-success" href="<?php echo e(route('sales.create')); ?>"><?php echo e(__('nav.new_sale')); ?></a><?php endif; ?>
</div>
<form class="row g-2 mb-3">
    <div class="col-md-4"><input class="form-control" name="q" value="<?php echo e(request('q')); ?>" placeholder="<?php echo e(__('messages.search')); ?>"></div>
    <div class="col-md-2"><button class="btn btn-outline-secondary"><?php echo e(__('messages.filter')); ?></button></div>
</form>
<div class="card">
    <div class="table-responsive">
        <table class="table compact-table mb-0">
            <thead><tr>
                <th>#</th><th><?php echo e(__('messages.customer')); ?></th><th><?php echo e(__('messages.line')); ?></th>
                <th><?php echo e(__('messages.plan')); ?></th><th><?php echo e(__('messages.total')); ?></th><th><?php echo e(__('messages.date')); ?></th>
            </tr></thead>
            <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $sales; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><a href="<?php echo e(route('sales.show',$s)); ?>"><?php echo e($s->sale_number); ?></a></td>
                    <td><?php echo e($s->customer?->name); ?></td>
                    <td><?php echo e($s->line?->phone_number); ?></td>
                    <td><?php echo e($s->plan?->name ?? __('messages.no_plan')); ?></td>
                    <td><?php echo e(money($s->total)); ?></td>
                    <td><?php echo e(format_datetime($s->created_at)); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="6"><?php echo e(__('messages.no_results')); ?></td></tr>
            <?php endif; ?>
            </tbody>
        </table>
    </div>
    <?php echo $__env->make('partials.pagination', ['paginator' => $sales], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\laragon\www\esim\resources\views/sales/index.blade.php ENDPATH**/ ?>