<?php $__env->startSection('title','Advanced Reports'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-shell">
    <div class="page-head"><div><h1 class="page-title">Advanced Reports</h1><div class="page-subtitle">Date-wise sales, purchase, profit, due and top products</div></div></div>
    <form class="card panel-tight row" method="GET"><div class="col"><label>From</label><input type="date" name="from" value="<?php echo e($from); ?>"></div><div class="col"><label>To</label><input type="date" name="to" value="<?php echo e($to); ?>"></div><div class="col actions"><button class="btn primary">Generate</button></div></form>
    <div class="grid-4">
        <div class="stat"><div class="k">Sales</div><div class="v"><?php echo e(number_format($summary['sales'],2)); ?></div></div>
        <div class="stat"><div class="k">Purchase</div><div class="v"><?php echo e(number_format($summary['purchase'],2)); ?></div></div>
        <div class="stat"><div class="k">Profit</div><div class="v"><?php echo e(number_format($summary['profit'],2)); ?></div></div>
        <div class="stat"><div class="k">Expense</div><div class="v"><?php echo e(number_format($summary['expense'],2)); ?></div></div>
    </div>
    <div class="grid-2">
        <div class="card panel-tight table-wrap"><h3>Top Selling Products</h3><table class="table"><thead><tr><th>Product</th><th>Qty</th><th>Amount</th></tr></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $topProducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><?php echo e($item->product_name); ?></td><td><?php echo e($item->qty); ?></td><td><?php echo e(number_format($item->amount,2)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="3">No data.</td></tr><?php endif; ?></tbody></table></div>
        <div class="card panel-tight table-wrap"><h3>Low Stock Alert</h3><table class="table"><thead><tr><th>Code</th><th>Product</th><th>Stock</th></tr></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $lowStock; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><?php echo e($item->product_code); ?></td><td><?php echo e($item->product_name); ?></td><td><?php echo e($item->stock_quantity); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="3">No low stock product.</td></tr><?php endif; ?></tbody></table></div>
    </div>
    <div class="card panel-tight table-wrap"><h3>Daily Sales</h3><table class="table"><thead><tr><th>Date</th><th>Amount</th></tr></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $dailySales; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><?php echo e($item->sale_date); ?></td><td><?php echo e(number_format($item->amount,2)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="2">No data.</td></tr><?php endif; ?></tbody></table></div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH J:\xampp\htdocs\pos\resources\views/admin/reports/index.blade.php ENDPATH**/ ?>