<?php $__env->startSection('title', 'Invoices'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-6">
    <div class="flex flex-col md:flex-row md:items-end justify-between gap-4">
        <div>
            <p class="text-xs font-bold uppercase tracking-[0.18em] text-sky-600">Accounts receivable</p>
            <h1 class="text-2xl font-extrabold text-slate-950 dark:text-white">Invoices</h1>
            <p class="text-sm text-slate-500">Individual, application, renewal and corporate monthly invoices.</p>
        </div>
        <a href="<?php echo e(route('app.cashier')); ?>" class="px-4 py-2.5 rounded-xl bg-sky-600 text-white text-xs font-bold">Open POS</a>
    </div>

    <div class="bg-white dark:bg-slate-800 rounded-3xl border border-slate-200 dark:border-slate-700 shadow-sm overflow-hidden">
        <form class="p-4 border-b border-slate-200 dark:border-slate-700 flex flex-col sm:flex-row gap-3">
            <input name="q" value="<?php echo e(request('q')); ?>" placeholder="Invoice, customer or company…" class="flex-1 rounded-xl border-slate-200 bg-slate-50 px-4 py-2 text-sm">
            <select name="status" class="rounded-xl border-slate-200 bg-slate-50 px-4 py-2 text-sm">
                <option value="">All statuses</option>
                <?php $__currentLoopData = ['unpaid','partially_paid','paid','overpaid','refunded','cancelled']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($status); ?>" <?php if(request('status') === $status): echo 'selected'; endif; ?>><?php echo e(str_replace('_', ' ', ucfirst($status))); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
            <button class="rounded-xl bg-slate-900 px-5 py-2 text-xs font-bold text-white">Filter</button>
        </form>
        <div class="overflow-x-auto">
            <table class="w-full text-sm">
                <thead class="bg-slate-50 dark:bg-slate-900/50 text-[11px] uppercase text-slate-500"><tr><th class="p-4 text-left">Invoice</th><th class="p-4 text-left">Account</th><th class="p-4 text-left">Date</th><th class="p-4 text-right">Total</th><th class="p-4 text-right">Paid</th><th class="p-4 text-right">Balance</th><th class="p-4 text-center">Status</th></tr></thead>
                <tbody class="divide-y divide-slate-100 dark:divide-slate-700">
                    <?php $__empty_1 = true; $__currentLoopData = $invoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="hover:bg-slate-50 dark:hover:bg-slate-900/30">
                            <td class="p-4"><a class="font-bold text-sky-700" href="<?php echo e(route('app.billing.invoices.show', $invoice->id)); ?>"><?php echo e($invoice->invoice_number); ?></a><p class="text-[11px] text-slate-400"><?php echo e(str_replace('_', ' ', $invoice->invoice_type)); ?></p></td>
                            <td class="p-4 font-medium"><?php echo e($invoice->customer?->full_name_en ?? $invoice->company?->name_en ?? 'General account'); ?></td>
                            <td class="p-4 text-slate-500"><?php echo e($invoice->invoice_date->format('d M Y')); ?></td>
                            <td class="p-4 text-right font-bold">AED <?php echo e(number_format((float) $invoice->total_amount, 2)); ?></td>
                            <td class="p-4 text-right text-emerald-600">AED <?php echo e(number_format((float) $invoice->paid_amount, 2)); ?></td>
                            <td class="p-4 text-right text-rose-600">AED <?php echo e(number_format((float) $invoice->balance_due, 2)); ?></td>
                            <td class="p-4 text-center"><span class="rounded-full bg-slate-100 px-2.5 py-1 text-[10px] font-bold uppercase text-slate-600"><?php echo e(str_replace('_', ' ', $invoice->status)); ?></span></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="7" class="p-12 text-center text-slate-400">No invoices found.</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <div class="p-4"><?php echo e($invoices->links()); ?></div>
    </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\typingcenter\resources\views\tenant\billing\invoices\index.blade.php ENDPATH**/ ?>