<?php $__env->startSection('title', 'Chart of Accounts'); ?>
<?php $__env->startSection('page_title', 'Chart of Accounts'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li><li class="breadcrumb-item active">Chart of Accounts</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page_actions'); ?>
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('accounting.create')): ?><a href="<?php echo e(route('accounts.create')); ?>" class="btn btn-primary"><i class="bi bi-plus-lg me-1"></i>Add Account</a><?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="row g-3">
        <?php $__currentLoopData = App\Models\Account::TYPES; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="col-lg-6">
                <div class="card h-100">
                    <div class="card-header text-capitalize"><span class="badge bg-soft-<?php echo e(['asset'=>'primary','liability'=>'warning','equity'=>'info','income'=>'success','expense'=>'danger'][$type]); ?> me-1"><?php echo e($type); ?></span> Accounts</div>
                    <div class="card-body p-0">
                        <table class="table table-sm table-hover align-middle mb-0">
                            <thead><tr><th>Code</th><th>Name</th><th class="text-end">Balance</th><th></th></tr></thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $accounts[$type] ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $acc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td class="small"><?php echo e($acc->code); ?></td>
                                        <td><?php echo e($acc->name); ?> <?php if($acc->is_system): ?><i class="bi bi-lock-fill text-muted small" title="System account"></i><?php endif; ?></td>
                                        <td class="text-end"><?php echo e(number_format($acc->naturalBalance())); ?></td>
                                        <td class="text-end">
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('accounting.update')): ?><a href="<?php echo e(route('accounts.edit', $acc)); ?>" class="btn btn-sm btn-light border py-0"><i class="bi bi-pencil"></i></a><?php endif; ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('accounting.delete')): ?><?php if (! ($acc->is_system)): ?><form method="POST" action="<?php echo e(route('accounts.destroy', $acc)); ?>" class="d-inline" data-confirm="Delete <?php echo e($acc->name); ?>?"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button class="btn btn-sm btn-light border py-0 text-danger"><i class="bi bi-trash"></i></button></form><?php endif; ?> <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr><td colspan="4" class="text-muted text-center small py-2">No accounts.</td></tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </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/accounts/index.blade.php ENDPATH**/ ?>