<?php $__env->startSection('content'); ?>
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-money"></i> <?php echo e(trans('application.payments')); ?></h1>
</div>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <?php if(hasPermission('add_payment')): ?>
                    <div class="box-header with-border">
                        <h3 class="box-title pull-right">
                            <div class="box-tools ">
                                <a href="<?php echo e(route('payments.create')); ?>" class="btn btn-primary btn-xs pull-right" data-toggle="ajax-modal"> <i class="fa fa-plus"></i> <?php echo e(trans('application.record_payment')); ?></a>
                            </div>
                        </h3>
                    </div>
                <?php endif; ?>
                <div class="box-body">
                    <table class="table table-bordered table-striped table-hover datatable">
                        <thead>
                        <tr>
                            <th></th>
                            <th><?php echo e(trans('application.invoice_number')); ?></th>
                            <th><?php echo e(trans('application.client')); ?></th>
                            <th><?php echo e(trans('application.date')); ?></th>
                            <th class="text-right"><?php echo e(trans('application.amount')); ?></th>
                            <th><?php echo e(trans('application.action')); ?> </th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach($payments as $payment): ?>
                        <tr>
                            <td></td>
                            <td><a href="<?php echo e(route('invoices.show', $payment->invoice_id)); ?>"><?php echo e($payment->invoice->number); ?></a> </td>
                            <td><a href="<?php echo e(route('clients.show', $payment->invoice->client_id )); ?>"><?php echo e($payment->invoice->client->name); ?></a> </td>
                            <td><?php echo e($payment->payment_date); ?> </td>
                            <td class="text-right"><?php echo e($payment->invoice->currency.format_amount($payment->amount)); ?> </td>
                            <td>
                                <?php if(hasPermission('edit_payment')): ?>
                                    <?php echo edit_btn('payments.edit', $payment->uuid); ?>
                                <?php endif; ?>
                                <?php if(hasPermission('delete_payment')): ?>
                                    <?php echo delete_btn('payments.destroy', $payment->uuid); ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>