<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body p-4">
        <?php echo $__env->make('reports.partials.header', ['title' => $title, 'period' => __('As of').' '.\App\Support\DualDate::format(now(), 'Y-m-d')], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
        <div class="text-end mb-3 no-print"><button onclick="window.print()" class="btn btn-light btn-sm"><i class="fa-solid fa-print me-1"></i><?php echo e(__('Print')); ?></button></div>
        <div class="table-responsive">
            <table class="table">
                <thead><tr><th><?php echo e($type === 'customer' ? __('Customer') : __('Supplier')); ?></th><th><?php echo e(__('Phone')); ?></th><th class="text-end"><?php echo e(__('Current Balance')); ?></th><th class="no-print"></th></tr></thead>
                <tbody>
                    <?php ($total = 0); ?>
                    <?php $__currentLoopData = $parties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $party): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php ($total += $party->balance); ?>
                        <tr><td><?php echo e($party->name); ?></td><td><?php echo e($party->phone ?: '-'); ?></td><td class="text-end text-danger fw-bold money"><?php echo e(number_format($party->balance, 2)); ?> <?php echo e($moneyCode); ?></td><td class="text-end no-print"><a class="btn btn-light btn-sm" href="<?php echo e($type === 'customer' ? route('reports.customer-ledger', $party) : route('reports.supplier-ledger', $party)); ?>"><i class="fa-solid fa-book"></i></a></td></tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
                <tfoot><tr><th colspan="2"><?php echo e(__('Total Balance')); ?></th><th class="text-end money"><?php echo e(number_format($total, 2)); ?> <?php echo e($moneyCode); ?></th><th class="no-print"></th></tr></tfoot>
            </table>
        </div>
    </div>
</div>
<?php if(!empty($appSettings['report_footer'])): ?><p class="text-center text-muted small mt-3"><?php echo e($appSettings['report_footer']); ?></p><?php endif; ?>
<?php $__env->stopSection(); ?>

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