

<?php $__env->startSection('title', 'Laporan harian — '.config('portal.product_line')); ?>
<?php $__env->startSection('page_heading', 'Laporan — Harian (gabungan)'); ?>
<?php $__env->startSection('page_subheading', 'Satu baris per tanggal: order & omzet FnB vs transaksi & omzet refleksologi. Gunakan nomor halaman di bawah tabel.'); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('owner.reports._nav', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <?php echo $__env->make('owner.reports._filters', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <?php if(!empty($data['errors'])): ?>
        <div class="mb-6 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-950" role="alert">
            <p class="font-semibold text-amber-900">Perlu perhatian</p>
            <ul class="mt-2 list-disc space-y-1 pl-5">
                <?php $__currentLoopData = $data['errors']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $err): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li><span class="font-medium"><?php echo e($err['source']); ?></span>: <?php echo e($err['message']); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>
    <?php endif; ?>

    <div class="overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-sm">
        <div class="border-b border-slate-100 px-4 py-3 md:px-5">
            <h2 class="text-sm font-semibold text-slate-900">Tabel harian periode <?php echo e($dateFrom); ?> — <?php echo e($dateTo); ?></h2>
            <p class="mt-0.5 text-xs text-slate-500">Total <?php echo e($dailyPaginator->total()); ?> hari dengan data · menampilkan <?php echo e($dailyPaginator->count()); ?> baris di halaman ini.</p>
        </div>
        <?php if($dailyPaginator->total() > 0): ?>
            <div class="overflow-x-auto">
                <table class="min-w-full text-sm">
                    <thead class="bg-slate-50 text-left text-xs uppercase text-slate-600">
                        <tr>
                            <th class="px-4 py-3">Tanggal</th>
                            <th class="px-4 py-3 text-right">Order FnB</th>
                            <th class="px-4 py-3 text-right">Rev. FnB</th>
                            <th class="px-4 py-3 text-right">Trx reflex</th>
                            <th class="px-4 py-3 text-right">Omzet reflex</th>
                            <th class="px-4 py-3 text-right">Rev. gabungan</th>
                            <th class="px-4 py-3 text-right">Kontrib. gab.</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-slate-100">
                        <?php $__currentLoopData = $dailyPaginator; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr class="hover:bg-slate-50/80">
                                <td class="whitespace-nowrap px-4 py-2.5 font-medium text-slate-800"><?php echo e($row['date']); ?></td>
                                <td class="px-4 py-2.5 text-right tabular-nums text-slate-700"><?php echo e(number_format($row['fnb_order_count'] ?? 0, 0, ',', '.')); ?></td>
                                <td class="px-4 py-2.5 text-right tabular-nums text-slate-700">Rp <?php echo e(number_format($row['fnb_revenue'] ?? 0, 0, ',', '.')); ?></td>
                                <td class="px-4 py-2.5 text-right tabular-nums text-slate-700"><?php echo e(number_format($row['reflex_transaction_count'] ?? 0, 0, ',', '.')); ?></td>
                                <td class="px-4 py-2.5 text-right tabular-nums text-slate-700">Rp <?php echo e(number_format($row['reflex_gross_revenue'] ?? 0, 0, ',', '.')); ?></td>
                                <td class="px-4 py-2.5 text-right tabular-nums font-medium text-slate-900">Rp <?php echo e(number_format($row['combined_revenue'] ?? 0, 0, ',', '.')); ?></td>
                                <td class="px-4 py-2.5 text-right tabular-nums text-emerald-700">Rp <?php echo e(number_format($row['combined_contribution'] ?? 0, 0, ',', '.')); ?></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
            <div class="border-t border-slate-100 px-4 py-3">
                <?php echo e($dailyPaginator->withQueryString()->links('vendor.pagination.tailwind')); ?>

            </div>
        <?php else: ?>
            <div class="px-4 py-10 text-center text-sm text-slate-500">Belum ada baris harian untuk rentang ini.</div>
        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.portal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\sysorder\resources\views/owner/reports/harian.blade.php ENDPATH**/ ?>