<?php $__env->startSection('title', $invoice->invoice_number); ?>
<?php $__env->startSection('content'); ?>
<h1 class="h4"><?php echo e($invoice->invoice_number); ?> <span class="badge text-bg-secondary"><?php echo e($invoice->status->label()); ?></span></h1>
<p><?php echo e($invoice->customer?->name); ?> — <?php echo e($invoice->line?->phone_number); ?></p>
<p><?php echo e(__('messages.total')); ?>: <?php echo e(money($invoice->total)); ?> · <?php echo e(__('messages.paid')); ?>: <?php echo e(money($invoice->paid)); ?> · <?php echo e(__('messages.remaining')); ?>: <?php echo e(money($invoice->remaining)); ?></p>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('invoices.print')): ?>
<a class="btn btn-outline-secondary" href="<?php echo e(route('invoices.print',$invoice)); ?>"><?php echo e(__('messages.a4')); ?></a>
<a class="btn btn-outline-secondary" href="<?php echo e(route('invoices.thermal',$invoice)); ?>"><?php echo e(__('messages.thermal')); ?></a>
<a class="btn btn-outline-secondary" href="<?php echo e(route('invoices.pdf',$invoice)); ?>">PDF</a>
<?php endif; ?>
<table class="table mt-3"><?php $__currentLoopData = $invoice->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr><td><?php echo e($item->description); ?></td><td><?php echo e(money($item->unit_price)); ?></td><td><?php echo e(money($item->total)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></table>
<?php if($invoice->status->isOpen()): ?>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('invoices.cancel')): ?>
<form method="post" action="<?php echo e(route('invoices.cancel',$invoice)); ?>" class="mt-3"><?php echo csrf_field(); ?>
<input class="form-control mb-2" name="reason" required placeholder="<?php echo e(__('messages.reason')); ?>">
<button class="btn btn-outline-danger"><?php echo e(__('messages.cancel')); ?></button>
</form>
<?php endif; ?>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('payments.create')): ?>
<form method="post" action="<?php echo e(route('payments.store')); ?>" class="card card-body mt-3"><?php echo csrf_field(); ?>
<input type="hidden" name="invoice_id" value="<?php echo e($invoice->id); ?>">
<div class="row g-2">
<div class="col-md-4"><input class="form-control" name="amount" value="<?php echo e($invoice->remaining); ?>" required></div>
<div class="col-md-4"><select class="form-select" name="payment_method"><?php $__currentLoopData = ['cash','visa','bank','wallet','other']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $m): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($m); ?>"><?php echo e(__('status.method_'.$m)); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div>
<div class="col-md-4"><button class="btn btn-success"><?php echo e(__('messages.collect')); ?></button></div>
</div></form>
<?php endif; ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\laragon\www\esim\resources\views/invoices/show.blade.php ENDPATH**/ ?>