<?php $__env->startSection('content'); ?>
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-money"></i> Payments</h1>
</div>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <!--    Hover Rows  -->
            <a href="<?php echo e(route('payments.create')); ?>" class="btn btn-primary btn-sm pull-right" data-toggle="ajax-modal"> <i class="fa fa-plus"></i> Record Payment</a> <br/><br/>
            <?php if(Session::has('flash_notification.message')): ?>
            <?php echo message(); ?>

            <?php endif; ?>
            <div class="panel panel-default">
                <div class="panel-heading">Payments</div>
                <div class="panel-body">
                    <table class="table table-bordered table-striped table-hover datatable">
                        <thead>
                        <tr>
                            <th></th>
                            <th>Invoice No.</th>
                            <th>Client</th>
                            <th>Date</th>
                            <th class="text-right">Amount</th>
                            <th>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.$payment->amount); ?> </td>
                            <td>
                                <?php echo edit_btn('payments.edit', $payment->id); ?>

                                <?php echo delete_btn('payments.destroy', $payment->id); ?>

                            </td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- End  Hover Rows  -->
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>

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