financialCalculations.php 2.86 KB
<h2 class="content-header">
    <?= $t->_(isset(explode('/', $this->router->getRewriteUri())[2])? explode('/', $this->router->getRewriteUri())[2] : 'main') ?>
</h2>
<section style="overflow: visible" class="content">
    <div class="main_block">
        <div class="fin_content">

            <div class="line l_one">
                <div class="fin_cell c_one"><span style="display:none;"><?= $t->_('order_number') ?></span></div>
                <div class="fin_cell c_two"><span><?= $t->_('invoice') ?></span></div>
                <div class="fin_cell c_two"><span><?= $t->_('actually_paid') ?></span></div>
                <div class="fin_cell c_two"><span>Статус</span></div>
                <div class="fin_cell c_two"><span>Дата</span></div>
            </div>

            <div class="order_lines">
                <?php if(isset($payment) && !empty($payment)): ?>
                <?php foreach($payment as $item): ?>
                <div class="order_line">
                    <div class="fin_cell c_one">
                        <span style="display:none;">
                            <a href="#"><?= $t->_('orders') ?> №12345</a>
                        </span>
                    </div>
                    <div class="fin_cell c_two money">
                        <?php if($item['amount'] > 0): ?>
                        <span><?= $item['amount'] ?></span> грн.
                        <?php endif; ?>
                    </div>
                    <div class="fin_cell c_two money">
                        <?php if($item['amount'] < 0): ?>
                        <span><?= -$item['amount'] ?></span> грн.
                        <?php endif; ?>
                    </div>
                    <div style="color: #333" class="fin_cell c_two money">
                        <?= $t->_($item['type']) ?>
                    </div>
                    <div style="color: #333" class="fin_cell c_two money">
                        <?= date('d.m.Y', strtotime($item['date'])) ?>
                    </div>
                </div>
                <?php endforeach; ?>
                <?php endif; ?>
            </div>

            <div class="lines_final">
                <div class="line final_one">
                    <div style="box-sizing:border-box;height: 39px;width: 171px;max-width: 171px" class="fin_cell c_one"><span><?= $t->_('sum') ?></span></div>
                    <div class="fin_cell c_two money"><span><?= $sum_order ?></span> грн.</div>
                    <div class="fin_cell c_two money"><span><?= $sum_paid ?></span> грн.</div>
                </div>
                <div class="line final_two">
                    <div class="fin_cell c_one"><span>Сальдо</span></div>
                    <div class="fin_cell balance"><span><?= $sum_paid - $sum_order ?></span> грн.</div>
                </div>
            </div>
        </div>

    </div>
</section>