<?php $__env->startSection('content'); ?>
    <div class="col-md-12 content-header" >
        <h1><i class="fa fa-credit-card"></i> <?php echo e(trans('application.expenses')); ?></h1>
    </div>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box  box-primary">
                <?php if(hasPermission('add_expense')): ?>
                    <div class="box-header with-border">
                        <h3 class="box-title pull-right">
                            <div class="box-tools ">
                                <a href="<?php echo e(route('expenses.create')); ?>" class="btn btn-primary btn-xs pull-right" data-toggle="ajax-modal"> <i class="fa fa-plus"></i> New Expense</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.name')); ?></th>
                            <th><?php echo e(trans('application.date')); ?></th>
                            <th><?php echo e(trans('application.category')); ?></th>
                            <th><?php echo e(trans('application.amount')); ?></th>
                            <th><?php echo e(trans('application.action')); ?></th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach($expenses as $expense): ?>
                        <tr>
                            <td></td>
                            <td><?php echo e($expense->name); ?> </td>
                            <td><?php echo e($expense->expense_date); ?> </td>
                            <td><?php echo e($expense->category); ?> </td>
                            <td><?php echo e(format_amount($expense->amount)); ?> </td>
                            <td>
                                <?php if(hasPermission('edit_expense')): ?>
                                    <?php echo edit_btn('expenses.edit', $expense->uuid); ?>
                                <?php endif; ?>
                                <?php if(hasPermission('delete_expense')): ?>
                                    <?php echo delete_btn('expenses.destroy', $expense->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(); ?>