<?php $__env->startSection('content'); ?>

<div class="col-md-12 content-header" >

    <h1><i class="fa fa-file-pdf-o"></i> <?php echo e(trans('application.invoices')); ?></h1>

</div>

<section class="content">

    <div class="row">

        <div class="col-md-12">

            <div class="box">

                <div class="box-header with-border">
                    <h3 class="box-title pull-right">
                    <div class="box-tools ">
                        <a href="<?php echo e(route('invoices.create')); ?>" class="btn btn-primary btn-sm"> <i class="fa fa-plus"></i> <?php echo e(trans('application.new_invoice')); ?></a>
                    </div>
                    </h3>
                </div>

                <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.status')); ?></th>

                            <th><?php echo e(trans('application.client')); ?></th>

                            <th><?php echo e(trans('application.due_date')); ?></th>

                            <th class="text-right"><?php echo e(trans('application.amount')); ?></th>

                            <th class="text-right"><?php echo e(trans('application.paid')); ?></th>

                            <th class="text-right"><?php echo e(trans('application.amount_due')); ?></th>

                            <th><?php echo e(trans('application.action')); ?></th>

                        </tr>

                        </thead>

                        <tbody>

                        <?php foreach($invoices as $invoice): ?>

                        <tr>

                            <td></td>

                            <td><?php echo e($invoice->number); ?> </td>

                            <td ><span class="label <?php echo e(statuses()[$invoice->status]['class']); ?>"><?php echo e(ucwords(statuses()[$invoice->status]['label'])); ?> </span></td>

                            <td><a href="<?php echo e(route('clients.show', $invoice->client_id )); ?>"><?php echo e($invoice->client->name); ?></a> </td>

                            <td><?php echo e($invoice->due_date); ?> </td>

                            <td class="text-right"><?php echo e($invoice->currency.''.$invoice->totals['grandTotal']); ?> </td>

                            <td class="text-right"><?php echo e($invoice->currency.''.$invoice->totals['paid']); ?> </td>

                            <td class="text-right"><?php echo e($invoice->currency.''.$invoice->totals['amountDue']); ?> </td>

                            <td>

                                <a href="<?php echo route('invoices.show',$invoice->id); ?>" data-rel="tooltip" data-placement="top" title="View invoice" class="btn btn-sm btn-info"><i class="fa fa-eye"></i>  </a>

                                <a href="<?php echo url('invoices/pdf',$invoice->id); ?>" data-rel="tooltip" data-placement="top" title="Download invoice" class="btn btn-sm btn-primary"><i class="fa fa-download"></i> </a>

                                <a href="<?php echo route('payments.create','invoice_id='.$invoice->id); ?>" data-rel="tooltip" data-toggle="ajax-modal" data-placement="top" title="Add Payment" class="btn btn-sm btn-warning"><i class="fa fa-money"></i> </a>

                                <a href="<?php echo route('invoices.edit',$invoice->id); ?>" class="btn btn-sm btn-success"><i class="fa fa-pencil"></i> <?php echo e(trans('application.edit')); ?> </a>

                                <?php echo delete_btn('invoices.destroy', $invoice->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(); ?>