<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> <?php echo e(__('daily_income')); ?> <?php $__env->endSlot(); ?>

    <div class="card shadow-sm mb-4">
        <div class="card-body">
            <form method="GET" action="<?php echo e(route('reports.daily')); ?>" class="row g-2 align-items-end">
                <div class="col-auto">
                    <label for="date" class="form-label"><?php echo e(__('Date')); ?></label>
                    <input type="date" id="date" name="date" class="form-control" value="<?php echo e($date); ?>">
                </div>
                <div class="col-auto">
                    <button type="submit" class="btn btn-primary"><?php echo e(__('Filter')); ?></button>
                    <a href="<?php echo e(route('reports.daily.pdf', ['date' => $date])); ?>" class="btn btn-outline-danger ms-2">
                        <i class="bi bi-file-earmark-pdf"></i> PDF
                    </a>
                </div>
            </form>
        </div>
    </div>

    <div class="row g-3 mb-4">
        <div class="col-md-4">
            <div class="card text-bg-success shadow-sm">
                <div class="card-body text-center">
                    <h6 class="card-title"><?php echo e(__('sales')); ?></h6>
                    <h3><?php echo e(number_format($sales, 2)); ?></h3>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card text-bg-warning shadow-sm">
                <div class="card-body text-center">
                    <h6 class="card-title"><?php echo e(__('purchases')); ?></h6>
                    <h3><?php echo e(number_format($purchases, 2)); ?></h3>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card text-bg-danger shadow-sm">
                <div class="card-body text-center">
                    <h6 class="card-title"><?php echo e(__('expenses')); ?></h6>
                    <h3><?php echo e(number_format($expenses, 2)); ?></h3>
                </div>
            </div>
        </div>
    </div>

    <div class="card shadow-sm mb-4">
        <div class="card-header fw-bold"><?php echo e(__('Summary')); ?></div>
        <div class="card-body p-0">
            <table class="table table-bordered mb-0">
                <tbody>
                    <tr>
                        <td><?php echo e(__('sales')); ?></td>
                        <td class="text-end text-success fw-bold"><?php echo e(number_format($sales, 2)); ?></td>
                    </tr>
                    <tr>
                        <td><?php echo e(__('purchases')); ?></td>
                        <td class="text-end text-warning fw-bold"><?php echo e(number_format($purchases, 2)); ?></td>
                    </tr>
                    <tr>
                        <td><?php echo e(__('expenses')); ?></td>
                        <td class="text-end text-danger fw-bold"><?php echo e(number_format($expenses, 2)); ?></td>
                    </tr>
                    <tr class="table-dark">
                        <td><strong><?php echo e(__('Net Income')); ?></strong></td>
                        <?php $net = $sales - $purchases - $expenses; ?>
                        <td class="text-end fw-bold <?php echo e($net >= 0 ? 'text-success' : 'text-danger'); ?>">
                            <?php echo e(number_format($net, 2)); ?>

                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <?php if($customers->count()): ?>
    <div class="card shadow-sm">
        <div class="card-header fw-bold"><?php echo e(__('customer_dues')); ?></div>
        <div class="card-body p-0">
            <table class="table table-striped mb-0">
                <thead class="table-dark">
                    <tr>
                        <th>#</th>
                        <th><?php echo e(__('Name')); ?></th>
                        <th><?php echo e(__('Phone')); ?></th>
                        <th class="text-end"><?php echo e(__('Due')); ?></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($i + 1); ?></td>
                        <td><?php echo e($customer->name); ?></td>
                        <td><?php echo e($customer->phone); ?></td>
                        <td class="text-end text-danger"><?php echo e(number_format($customer->current_due, 2)); ?></td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>
    <?php endif; ?>

 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH C:\Users\anwar\OneDrive\Desktop\Babu KSA\software\restaurant-management\resources\views/reports/daily.blade.php ENDPATH**/ ?>