<?php
/**
 * Copyright © 2016 maijindou.com All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
    $_order  = $block->getOrder();
    $_source = $block->getSource();
    $_fullInfo = $this->helper('Magento\Tax\Helper\Data')->getCalculatedTaxes($_source);
    global $taxIter; $taxIter++;
?>

<?php if ($_fullInfo && $block->displayFullSummary()): ?>
        <?php foreach ($_fullInfo as $info): ?>
            <?php
                $percent    = $info['percent'];
                $amount     = $info['tax_amount'];
                $baseAmount = $info['base_tax_amount'];
                $title      = $info['title'];
            ?>
            <tr class="totals tax details details-<?php /* @escapeNotVerified */ echo $taxIter; ?> <?php echo($block->getIsPlaneMode()) ? ' plane' : '';?>">
                <td <?php /* @escapeNotVerified */ echo $block->getLabelProperties()?>>
                    <?php echo $block->escapeHtml($title); ?>
                    <?php if (!is_null($percent)): ?>
                        (<?php echo (float)$percent; ?>%)
                    <?php endif; ?>
                    <br />
                </td>
                <td <?php /* @escapeNotVerified */ echo $block->getValueProperties()?> rowspan="1">
                    <?php /* @escapeNotVerified */ echo $_order->formatPrice($amount); ?>
                </td>
            </tr>
        <?php endforeach; ?>
<?php endif;?>

<?php if ($block->displayFullSummary() && $_fullInfo && !$block->getIsPlaneMode()): ?>
<tr class="totals-tax-summary">
<?php elseif ($block->displayFullSummary() && $_fullInfo && $block->getIsPlaneMode()): ?>
<tr class="totals-tax-summary plane">
<?php else: ?>
<tr class="totals-tax">
<?php endif; ?>
    <th <?php /* @escapeNotVerified */ echo $block->getLabelProperties()?> scope="row">
        <?php if ($block->displayFullSummary()): ?>
            <div class="detailed"><?php /* @escapeNotVerified */ echo __('Tax'); ?></div>
        <?php else: ?>
            <?php /* @escapeNotVerified */ echo __('Tax'); ?>
        <?php endif;?>
    </th>
    <td <?php /* @escapeNotVerified */ echo $block->getValueProperties()?> data-th="<?php echo $block->escapeHtml(__('Tax')); ?>">
        <?php /* @escapeNotVerified */ echo $_order->formatPrice($_source->getTaxAmount()) ?>
    </td>
</tr>
