<div class="table-responsive">
    <table class="table table-list">
        <thead>
        <tr>
            <th><?php echo e(trans('validation.attributes.name')); ?></th>
            <th><?php echo e(trans('validation.attributes.type')); ?></th>
            <th><?php echo e(trans('global.quantity')); ?></th>
            <th><?php echo e(trans('validation.attributes.unit_cost')); ?></th>
            <th><?php echo e(trans('front.total')); ?></th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <?php if(count($expenses)): ?>
            <?php foreach($expenses as $expense): ?>
                <tr>
                    <td><?php echo e($expense->name); ?></td>
                    <td><?php echo e(isset($expense->type->name) ? $expense->type->name : ''); ?></td>
                    <td><?php echo e($expense->quantity); ?></td>
                    <td><?php echo e($expense->unit_cost); ?></td>
                    <td><?php echo e($expense->total); ?></td>
                    <td class="actions">
                        <a href="javascript:" class="btn icon edit"
                           data-url="<?php echo route('device_expenses.edit', ['id' => $expense->id]); ?>"
                           data-modal="expenses_edit"></a>

                        <a href="<?php echo route('device_expenses.destroy', ['id' => $expense->id]); ?>"
                           class="js-confirm-link btn icon delete"
                           data-confirm="<?php echo e(trans('admin.do_delete')); ?>"
                           data-method="DELETE">
                        </a>
                    </td>
                </tr>
            <?php endforeach; ?>
        <?php else: ?>
            <tr>
                <td colspan="7"><?php echo trans('front.nothing_found_request'); ?></td>
            </tr>
        <?php endif; ?>
        </tbody>
    </table>
</div>

<?php if(count($expenses)): ?>
    <div class="nav-pagination">
        <?php echo $expenses->setPath(route('device_expenses.table'))->appends(['device_id' => $device_id])->render(); ?>

    </div>
<?php endif; ?>

<div class="total" style="margin-top: 20px">
    <?php echo e(trans('front.total')); ?>: <?php echo e($total ?? '-'); ?>

</div>
