<?php $__env->startSection('title', ucfirst($kind) . ' Book'); ?>
<?php $__env->startSection('page_title', ucfirst($kind) . ' Book'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li><li class="breadcrumb-item active"><?php echo e(ucfirst($kind)); ?> Book</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card mb-3"><div class="card-body py-2">
        <form method="GET" class="row g-2 align-items-end">
            <div class="col-md-3"><label class="form-label small">From</label><input type="date" name="from" value="<?php echo e($from); ?>" class="form-control form-control-sm"></div>
            <div class="col-md-3"><label class="form-label small">To</label><input type="date" name="to" value="<?php echo e($to); ?>" class="form-control form-control-sm"></div>
            <div class="col-md-3"><button class="btn btn-sm btn-primary"><i class="bi bi-search me-1"></i>View</button></div>
        </form>
    </div></div>

    <?php $__empty_1 = true; $__currentLoopData = $books; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $book): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <div class="card mb-3">
            <div class="card-header d-flex justify-content-between">
                <span><i class="bi bi-<?php echo e($kind === 'cash' ? 'cash' : 'bank'); ?> me-1"></i><?php echo e($book['account']->label); ?></span>
                <span class="small">Closing: <strong><?php echo e(number_format($book['closing'], 2)); ?></strong></span>
            </div>
            <div class="card-body">
                <table class="table table-sm align-middle mb-0">
                    <thead><tr><th>Date</th><th>Entry</th><th>Description</th><th class="text-end">Receipt (Dr)</th><th class="text-end">Payment (Cr)</th><th class="text-end">Balance</th></tr></thead>
                    <tbody>
                        <tr class="table-light"><td colspan="5" class="fw-semibold">Opening</td><td class="text-end fw-semibold"><?php echo e(number_format($book['opening'], 2)); ?></td></tr>
                        <?php $__empty_2 = true; $__currentLoopData = $book['lines']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_2 = false; ?>
                            <tr>
                                <td class="small"><?php echo e($r['date']->format('d M Y')); ?></td>
                                <td class="small"><?php echo e($r['entry']); ?></td>
                                <td class="small"><?php echo e($r['description']); ?></td>
                                <td class="text-end text-success"><?php echo e($r['debit'] > 0 ? number_format($r['debit'], 2) : ''); ?></td>
                                <td class="text-end text-danger"><?php echo e($r['credit'] > 0 ? number_format($r['credit'], 2) : ''); ?></td>
                                <td class="text-end"><?php echo e(number_format($r['balance'], 2)); ?></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_2): ?>
                            <tr><td colspan="6" class="text-center text-muted py-2">No transactions.</td></tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <div class="card"><div class="card-body text-center text-muted py-4">No <?php echo e($kind); ?> accounts configured.</div></div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/u385418287/domains/itartificer.com/public_html/sms-erp/resources/views/accounting/reports/cashbank.blade.php ENDPATH**/ ?>