<?php $__env->startSection('content'); ?>
    <div>
        <div>
            <?php if($business): ?>
                <h5><?php echo ucfirst($business->name); ?></h5>
                <h6><?php echo $transactions[0]->business->address; ?></h6>
            <?php else: ?>
                <h5>All business</h5>
            <?php endif; ?>
        </div>

        <div>
            <h2>Transactions list (CIS)</h2>
            <?php if(isset($params) && isset($params['from']) && isset($params['to'])): ?>
                <h5>
                    From: <?php echo Helper::formatDate($param['from']); ?> - To: <?php echo Helper::formatDate($param['to']); ?>

                </h5>
            <?php endif; ?>
        </div>

        <table class="table">
            <thead>
            <tr>
                <th>Date</th>
                <th>Customer</th>
                <th>Net Amount</th>
                <th>CIS</th>
            </tr>
            </thead>
            <tbody>
            <?php foreach($transactions as $transaction): ?>
                <tr>
                    <td><?php echo Helper::formatDate($transaction->date); ?></td>
                    <td><?php echo $transaction->customer ? $transaction->customer->company_name : ''; ?></td>
                    <td class="text-right"><?php echo Helper::formatAmount($transaction->sum_amount); ?></td>
                    <td class="text-right"><?php echo Helper::formatAmount($transaction->sum_cis_deduction); ?></td>
                </tr>
            <?php endforeach; ?>
            </tbody>
            <tfoot>
            <tr>
                <th colspan="2">Total</th>
                <th class="text-right"><?php echo Helper::formatAmount(Helper::calculateTotalByAttribute($transactions, 'sum_amount')); ?></th>
                <th class="text-right"><?php echo Helper::formatAmount(Helper::calculateTotalByAttribute($transactions, 'sum_cis_deduction')); ?></th>
            </tr>
            </tfoot>
        </table>
    </div>
<?php $__env->stopSection(); ?>


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