

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

<?php $__env->startSection('content'); ?>
    <div class="page-header d-flex justify-content-between align-items-start flex-wrap gap-2">
        <div><h1 class="page-title">Transactions</h1></div>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('finance.transactions.create')): ?>
            <a href="<?php echo e(route('finance.transactions.create')); ?>" class="btn btn-primary btn-sm">Add Transaction</a>
        <?php endif; ?>
    </div>

    <?php echo $__env->make('finance::partials.filters', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <div class="card">
        <div class="table-responsive">
            <table class="table table-hover mb-0">
                <thead class="table-light">
                    <tr><th>Date</th><th>Type</th><th>Category</th><th>Amount</th><th>Reference</th><th class="text-end">Actions</th></tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($transaction->transaction_at->format('M j, Y H:i')); ?></td>
                            <td><span class="badge bg-<?php echo e($transaction->type->value === 'income' ? 'success' : 'danger'); ?>"><?php echo e(ucfirst($transaction->type->value)); ?></span></td>
                            <td><?php echo e($transaction->categoryName()); ?></td>
                            <td><?php echo e(platform_money($transaction->amount)); ?></td>
                            <td><?php echo e($transaction->reference_number ?? '—'); ?></td>
                            <td class="text-end">
                                <a href="<?php echo e(route('finance.transactions.show', $transaction)); ?>" class="btn btn-sm btn-outline-secondary">View</a>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('finance.transactions.update')): ?>
                                    <a href="<?php echo e(route('finance.transactions.edit', $transaction)); ?>" class="btn btn-sm btn-outline-primary">Edit</a>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="6" class="text-center text-muted py-4">No transactions found</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <?php if($transactions->hasPages()): ?>
            <div class="card-footer"><?php echo e($transactions->links()); ?></div>
        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('eliteadmin::layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\RABI\rabi\module-laravel-platform\apps\admin\modules\Finance/resources/views/transactions/index.blade.php ENDPATH**/ ?>