<div class="col-md-12">
    <table class="table table-hover table-striped table-bordered datatable">
        <thead>
        <tr class="table_header">
            <th><?php echo e(trans('application.date')); ?> </th>
            <th><?php echo e(trans('application.activity')); ?></th>
            <th class="text-right"><?php echo e(trans('application.invoices')); ?></th>
            <th class="text-right"><?php echo e(trans('application.payments')); ?></th>
            <th class="text-right"><?php echo e(trans('application.balance')); ?></th>
        </tr>
        </thead>
        <tbody>
        <?php ($total = 0); ?>
        <?php if(!empty($statement)): ?>
            <?php $__currentLoopData = $statement; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $record): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                <?php ($total = ($record['transaction_type'] == 'payment') ? $total - currency_convert(getCurrencyId($record['currency']),$record['amount']) : $total + currency_convert(getCurrencyId($record['currency']),$record['amount'])); ?>
                <tr>
                    <td><?php echo e(format_date($record['date'])); ?></td>
                    <td><?php echo e($record['activity']); ?></td>
                    <td class="text-right text-red"><?php echo e($record['transaction_type'] != 'payment' ? format_amount(currency_convert(getCurrencyId($record['currency']),$record['amount'])) : ''); ?></td>
                    <td class="text-right text-green"><?php echo e($record['transaction_type'] == 'payment' ? format_amount(currency_convert(getCurrencyId($record['currency']),$record['amount'])) : ''); ?></td>
                    <td class="text-right text-bold"><?php echo e(format_amount($total)); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
            <tr>
                <td class="text-bold"><?php echo e(trans('application.total')); ?></td>
                <td class="text-right text-bold text-red" colspan="4"><?php echo e(defaultCurrency().' '.format_amount($total)); ?></td>
            </tr>
        <?php endif; ?>
        </tbody>
    </table>
</div>
