<?php $__env->startSection('content'); ?>
    <?php if($transactions && count($transactions)): ?>
        <div>
            <h4><?php echo ucfirst($businessName); ?></h4>
        </div>

        <div>
            <h2>Transactions list</h2>
            <h5 class="m-b">
                From: <?php echo Helper::formatDate($param['from']); ?> - To: <?php echo Helper::formatDate($param['to']); ?>

            </h5>
        </div>

        <table class="table">
            <thead style="text-align: center;">
            <tr>
                <th>Date</th>
                <th>Record type</th>
                <th>Name</th>
                <th>Amount</th>
                <th>Reference</th>
                <th>Note</th>
            </tr>
            </thead>
            <tbody>
            <?php foreach($transactions as $transaction): ?>
                <tr>
                    <td><?php echo Helper::formatDate($transaction->date); ?></td>
                    <td><?php echo $transaction->record_type->description; ?></td>
                    <td><?php echo $transaction->name; ?></td>
                    <td style="text-align: right;"><?php echo Helper::formatAmount($transaction->amount); ?></td>
                    <td><?php echo $transaction->reference; ?></td>
                    <td><?php echo $transaction->description; ?></td>
                </tr>
            <?php endforeach; ?>
            </tbody>
            <tfoot>
            <tr>
                <th colspan="3">Total</th>
                <th style="text-align: right;"><?php echo Helper::formatAmount(Helper::calculateTotal($transactions)); ?></th>
                <th colspan="2"></th>
            </tr>
            </tfoot>
        </table>
    <?php else: ?>
        <div>
            <h4><?php echo ucfirst($businessName); ?></h4>
        </div>

        <div>
            <h2>Transactions list</h2>
            <h5 class="m-b">
                From: <?php echo Helper::formatDate($param['from']); ?> - To: <?php echo Helper::formatDate($param['to']); ?>

            </h5>
        </div>

        <table class="table">
            <thead>
            <tr>
                <th>Date</th>
                <th>Record type</th>
                <th>Name</th>
                <th>Amount</th>
                <th>Reference</th>
                <th>Note</th>
            </tr>
            </thead>

            <tbody>
            <tr>
                <td class="text-center" colspan="6">No transactions</td>
            </tr>
            </tbody>
        </table>
    <?php endif; ?>
<?php $__env->stopSection(); ?>


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