<?php $__env->startSection('title', __('Invoices')); ?>
<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
        <div class="d-flex flex-wrap gap-2 justify-content-between mb-3">
            <form class="d-flex gap-2"><input name="search" class="form-control" placeholder="<?php echo e(__('Invoice number or customer')); ?>" value="<?php echo e(request('search')); ?>"><button class="btn btn-light"><i class="fa-solid fa-magnifying-glass"></i></button></form>
            <a href="<?php echo e(route('invoices.create')); ?>" class="btn btn-success"><i class="fa-solid fa-plus me-1"></i><?php echo e(__('New Sale')); ?></a>
        </div>
        <div class="table-responsive">
            <table class="table align-middle">
                <thead><tr><th><?php echo e(__('Invoice')); ?></th><th><?php echo e(__('Customer')); ?></th><th><?php echo e(__('Type')); ?></th><th><?php echo e(__('Total')); ?></th><th><?php echo e(__('Paid / Due')); ?></th><th><?php echo e(__('Status')); ?></th></tr></thead>
                <tbody><?php $__empty_1 = true; $__currentLoopData = $invoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><a class="fw-bold" href="<?php echo e(route('invoices.show', $invoice)); ?>"><?php echo e($invoice->invoice_number); ?></a><small class="d-block text-muted"><?php echo e(\App\Support\DualDate::format($invoice->invoice_date, 'd M Y')); ?></small></td><td><?php echo e($invoice->customer?->name ?? __('Walk-in Customer')); ?></td><td><?php echo e(__($invoice->sale_type === 'retail' ? 'Retail' : 'Wholesale')); ?></td><td class="money"><?php echo e(number_format($invoice->total, 2)); ?> <?php echo e($invoice->currency_code); ?></td><td><span class="text-success money"><?php echo e(number_format($invoice->paid_amount, 2)); ?></span> / <span class="text-danger money"><?php echo e(number_format($invoice->due_amount, 2)); ?></span></td><td><span class="badge badge-soft rounded-pill"><?php echo e(__(ucfirst($invoice->status))); ?></span></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="6" class="text-center text-muted py-5"><?php echo e(__('No invoices yet.')); ?></td></tr><?php endif; ?></tbody>
            </table>
        </div>
        <?php echo e($invoices->links('pagination::bootstrap-5')); ?>

    </div>
</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\TradeERP\resources\views/invoices/index.blade.php ENDPATH**/ ?>