

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

<?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">Finance Reports</h1></div>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('finance.export')): ?>
            <div class="d-flex gap-2 flex-wrap">
                <a href="<?php echo e(route('finance.exports.transactions', $filters)); ?>" class="btn btn-sm btn-outline-primary">Export Transactions</a>
                <a href="<?php echo e(route('finance.exports.income', $filters)); ?>" class="btn btn-sm btn-outline-primary">Export Income</a>
                <a href="<?php echo e(route('finance.exports.expense', $filters)); ?>" class="btn btn-sm btn-outline-primary">Export Expense</a>
                <a href="<?php echo e(route('finance.exports.profit-loss', $filters)); ?>" class="btn btn-sm btn-outline-primary">Export P&amp;L</a>
            </div>
        <?php endif; ?>
    </div>

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

    <div class="row g-3 mb-4">
        <div class="col-md-3"><div class="card"><div class="card-body"><div class="text-muted small">Total Income</div><strong><?php echo e(platform_money($profitLossReport['total_income'])); ?></strong></div></div></div>
        <div class="col-md-3"><div class="card"><div class="card-body"><div class="text-muted small">Total Expense</div><strong><?php echo e(platform_money($profitLossReport['total_expense'])); ?></strong></div></div></div>
        <div class="col-md-3"><div class="card"><div class="card-body"><div class="text-muted small">Net Profit</div><strong><?php echo e(platform_money($profitLossReport['net_profit'])); ?></strong></div></div></div>
        <div class="col-md-3"><div class="card"><div class="card-body"><div class="text-muted small">Profit Margin</div><strong><?php echo e($profitLossReport['profit_margin']); ?>%</strong></div></div></div>
    </div>

    <div class="row g-3">
        <div class="col-lg-6">
            <div class="card"><div class="card-header"><h5 class="mb-0">Income by Category</h5></div>
                <div class="table-responsive"><table class="table mb-0"><thead><tr><th>Category</th><th>Total</th><th>Count</th></tr></thead>
                    <tbody><?php $__currentLoopData = $incomeReport['by_category']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr><td><?php echo e($row['category_name']); ?></td><td><?php echo e(platform_money($row['total'])); ?></td><td><?php echo e($row['count']); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></tbody>
                </table></div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="card"><div class="card-header"><h5 class="mb-0">Expense by Category</h5></div>
                <div class="table-responsive"><table class="table mb-0"><thead><tr><th>Category</th><th>Total</th><th>Count</th></tr></thead>
                    <tbody><?php $__currentLoopData = $expenseReport['by_category']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr><td><?php echo e($row['category_name']); ?></td><td><?php echo e(platform_money($row['total'])); ?></td><td><?php echo e($row['count']); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></tbody>
                </table></div>
            </div>
        </div>
    </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/reports/index.blade.php ENDPATH**/ ?>