

<?php $__env->startSection('title', 'Platform Billing'); ?>
<?php $__env->startSection('page-title', 'Billing'); ?>
<?php $__env->startSection('page-subtitle', 'Manual subscription payment approvals and invoices'); ?>

<?php $__env->startSection('content'); ?>
<div class="card border-0 shadow-sm mb-4">
    <div class="card-header bg-white fw-semibold">Payment approvals</div>
    <div class="table-responsive">
        <table class="table mb-0"><thead><tr><th>Tenant</th><th>Plan</th><th>Amount</th><th>Reference</th><th>Status</th><th></th></tr></thead><tbody>
            <?php $__currentLoopData = $payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $payment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($payment->tenant?->name); ?></td><td><?php echo e($payment->plan?->name); ?></td><td><?php echo e(number_format($payment->amount, 2)); ?></td><td><?php echo e($payment->reference); ?></td><td><?php echo e($payment->status); ?></td>
                    <td class="text-end">
                        <?php if($payment->proof_path): ?><a class="btn btn-sm btn-outline-secondary" href="<?php echo e(asset('uploads/'.$payment->proof_path)); ?>" target="_blank">Proof</a><?php endif; ?>
                        <?php if($payment->status === 'pending'): ?>
                            <form method="POST" class="d-inline" action="<?php echo e(route('super.billing.approve', $payment)); ?>"><?php echo csrf_field(); ?><button class="btn btn-sm btn-success">Approve</button></form>
                            <form method="POST" class="d-inline" action="<?php echo e(route('super.billing.reject', $payment)); ?>"><?php echo csrf_field(); ?><input type="hidden" name="rejected_reason" value="Payment proof was not accepted."><button class="btn btn-sm btn-outline-danger">Reject</button></form>
                        <?php endif; ?>
                    </td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody></table>
    </div>
    <div class="card-body"><?php echo e($payments->links()); ?></div>
</div>

<div class="card border-0 shadow-sm">
    <div class="card-header bg-white fw-semibold">Recent invoices</div>
    <div class="table-responsive">
        <table class="table mb-0"><thead><tr><th>Invoice</th><th>Tenant</th><th>Amount</th><th>Status</th><th>Paid</th></tr></thead><tbody>
            <?php $__currentLoopData = $invoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr><td><?php echo e($invoice->invoice_number); ?></td><td><?php echo e($invoice->tenant?->name); ?></td><td><?php echo e(number_format($invoice->amount, 2)); ?></td><td><?php echo e($invoice->status); ?></td><td><?php echo e(app_date($invoice->paid_at)); ?></td></tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody></table>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Polite hp\Documents\Codex\2026-05-08\build-a-complete-production-ready-saas\microfinance-saas\resources\views\super\billing\index.blade.php ENDPATH**/ ?>