<?php $__env->startSection('title', 'Balance Sheet'); ?>
<?php $__env->startSection('page_title', 'Balance Sheet'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li><li class="breadcrumb-item active">Balance Sheet</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">As of</label><input type="date" name="as_of" value="<?php echo e($asOf); ?>" 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>Generate</button></div>
        </form>
    </div></div>

    <div class="row g-3">
        <div class="col-lg-6">
            <div class="card h-100"><div class="card-header text-primary"><i class="bi bi-bank me-1"></i>Assets</div><div class="card-body">
                <table class="table table-sm mb-0">
                    <tbody>
                        <?php $__currentLoopData = $assets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr><td><?php echo e($r['account']->name); ?></td><td class="text-end"><?php echo e(number_format($r['amount'], 2)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                    <tfoot class="table-light"><tr class="fw-bold"><td>Total Assets</td><td class="text-end"><?php echo e(number_format($totalAssets, 2)); ?></td></tr></tfoot>
                </table>
            </div></div>
        </div>
        <div class="col-lg-6">
            <div class="card h-100"><div class="card-header text-warning"><i class="bi bi-cash-stack me-1"></i>Liabilities & Equity</div><div class="card-body">
                <table class="table table-sm mb-0">
                    <tbody>
                        <?php $__currentLoopData = $liabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr><td><?php echo e($r['account']->name); ?></td><td class="text-end"><?php echo e(number_format($r['amount'], 2)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php $__currentLoopData = $equity; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr><td><?php echo e($r['account']->name); ?></td><td class="text-end"><?php echo e(number_format($r['amount'], 2)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <tr><td>Net Profit / (Loss) to date</td><td class="text-end"><?php echo e(number_format($netProfit, 2)); ?></td></tr>
                    </tbody>
                    <tfoot class="table-light"><tr class="fw-bold"><td>Total Liabilities & Equity</td><td class="text-end"><?php echo e(number_format($totalLiabEquity, 2)); ?></td></tr></tfoot>
                </table>
            </div></div>
        </div>
        <div class="col-12">
            <div class="alert <?php echo e(abs($totalAssets - $totalLiabEquity) < 0.01 ? 'alert-success' : 'alert-warning'); ?> small mb-0">
                <?php echo e(abs($totalAssets - $totalLiabEquity) < 0.01 ? '✓ Balance sheet balances.' : 'Difference: '.number_format($totalAssets - $totalLiabEquity, 2)); ?>

            </div>
        </div>
    </div>
<?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/balance-sheet.blade.php ENDPATH**/ ?>