<?php $__env->startSection('title',ucfirst($type)); ?>
<?php $__env->startSection('content'); ?>
<div class="page-head"><div><h1><?php echo e(ucfirst($type)); ?></h1><p><?php echo e($type==='receipts'?'Customer collections posted to cash/bank and receivables.':($type==='payments'?'Supplier payments posted to payables and cash/bank.':'Operating expenses with VAT and double-entry posting.')); ?></p></div><a href="<?php echo e(route('treasury.create',$type)); ?>" class="btn btn-primary btn-dense"><i class="bi bi-plus-lg me-1"></i>New <?php echo e(rtrim($type,'s')); ?></a></div>
<div class="d-flex gap-2 mb-2"><a class="btn btn-sm <?php echo e($type==='receipts'?'btn-dark':'btn-light border'); ?>" href="<?php echo e(route('treasury.index','receipts')); ?>">Receipts</a><a class="btn btn-sm <?php echo e($type==='payments'?'btn-dark':'btn-light border'); ?>" href="<?php echo e(route('treasury.index','payments')); ?>">Payments</a><a class="btn btn-sm <?php echo e($type==='expenses'?'btn-dark':'btn-light border'); ?>" href="<?php echo e(route('treasury.index','expenses')); ?>">Expenses</a></div>
<div class="card-erp"><div class="table-responsive"><table class="table table-dense"><thead><?php if($type==='receipts'): ?><tr><th>Receipt</th><th>Date</th><th>Customer</th><th>Method</th><th>Reference</th><th class="text-end">Amount</th><th>Status</th></tr><?php elseif($type==='payments'): ?><tr><th>Payment</th><th>Date</th><th>Supplier</th><th>Method</th><th>Reference</th><th class="text-end">Amount</th><th>Status</th></tr><?php else: ?><tr><th>Expense</th><th>Date</th><th>Account</th><th>Payment account</th><th>Reference</th><th class="text-end">Taxable</th><th class="text-end">VAT</th><th class="text-end">Total</th></tr><?php endif; ?></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $records; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><?php if($type==='receipts'): ?><tr><td class="fw-bold text-accent"><?php echo e($r->receipt_no); ?></td><td><?php echo e($r->receipt_date->format('d M Y')); ?></td><td><?php echo e($r->customer?->name_en); ?></td><td><?php echo e(ucfirst($r->payment_method)); ?></td><td><?php echo e($r->reference?:'—'); ?></td><td class="text-end fw-bold"><?php echo e(number_format((float)$r->amount,2)); ?></td><td><span class="badge status-<?php echo e($r->status); ?>"><?php echo e(strtoupper($r->status)); ?></span></td></tr><?php elseif($type==='payments'): ?><tr><td class="fw-bold text-accent"><?php echo e($r->payment_no); ?></td><td><?php echo e($r->payment_date->format('d M Y')); ?></td><td><?php echo e($r->supplier?->name_en); ?></td><td><?php echo e(ucfirst($r->payment_method)); ?></td><td><?php echo e($r->reference?:'—'); ?></td><td class="text-end fw-bold"><?php echo e(number_format((float)$r->amount,2)); ?></td><td><span class="badge status-<?php echo e($r->status); ?>"><?php echo e(strtoupper($r->status)); ?></span></td></tr><?php else: ?><tr><td class="fw-bold text-accent"><?php echo e($r->expense_no); ?></td><td><?php echo e($r->expense_date->format('d M Y')); ?></td><td><?php echo e($r->expenseAccount?->name_en); ?></td><td><?php echo e($r->paymentAccount?->name_en); ?></td><td><?php echo e($r->reference?:'—'); ?></td><td class="text-end"><?php echo e(number_format((float)$r->taxable_amount,2)); ?></td><td class="text-end"><?php echo e(number_format((float)$r->vat_amount,2)); ?></td><td class="text-end fw-bold"><?php echo e(number_format((float)$r->total_amount,2)); ?></td></tr><?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="8" class="text-center text-muted py-5">No <?php echo e($type); ?> posted.</td></tr><?php endif; ?></tbody></table></div><?php if($records->hasPages()): ?><div class="card-erp-body border-top"><?php echo e($records->links()); ?></div><?php endif; ?></div>
<?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\saudi\resources\views\treasury\index.blade.php ENDPATH**/ ?>