<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// phpcs:disable Magento2.Templates.ThisInTemplate

/* @var \Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Form $block */
?>
<form id="edit_form" method="post" action="<?= $block->escapeUrl($block->getSaveUrl()) ?>">
    <?= $block->getBlockHtml('formkey') ?>
    <?php  $_order = $block->getCreditmemo()->getOrder() ?>

    <?= $block->getChildHtml('order_info') ?>

    <section class="admin__page-section">
        <div class="admin__page-section-title">
            <span class="title"><?= $block->escapeHtml(__('Payment &amp; Shipping Method')) ?></span>
        </div>
        <div class="admin__page-section-content">
        <?php if (!$_order->getIsVirtual()) : ?>
        <div class="admin__page-section-item order-payment-method">
        <?php else : ?>
        <div class="admin__page-section-item order-payment-method order-payment-method-virtual">
        <?php endif; ?>

            <?php /* Billing Address */ ?>
            <div class="admin__page-section-item-title">
                <span class="title"><?= $block->escapeHtml(__('Payment Information')) ?></span>
            </div>
            <div class="admin__page-section-item-content">
                <div class="order-payment-method-title"><?= $block->getChildHtml('order_payment') ?></div>
                <div class="order-payment-currency">
                    <?= $block->escapeHtml(__('The order was placed using %1.', $_order->getOrderCurrencyCode())) ?>
                </div>
                <div class="order-payment-additional">
                    <?= $block->getChildHtml('order_payment_additional') ?>
                </div>
            </div>
        </div>

        <?php if (!$_order->getIsVirtual()) : ?>
        <div class="admin__page-section-item order-shipping-address">
            <?php /* Shipping Address */ ?>
            <div class="admin__page-section-item-title">
                <span class="title"><?= $block->escapeHtml(__('Shipping Information')) ?></span>
            </div>
            <div class="admin__page-section-item-content shipping-description-wrapper">
                <div class="shipping-description-title"><?= $block->escapeHtml($_order->getShippingDescription()) ?></div>
                <div class="shipping-description-content">
                    <?= $block->escapeHtml(__('Total Shipping Charges')) ?>:

                    <?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesPriceInclTax($block->getSource()->getStoreId())) : ?>
                        <?php $_excl = $block->displayShippingPriceInclTax($_order); ?>
                    <?php else : ?>
                        <?php $_excl = $block->displayPriceAttribute('shipping_amount', false, ' '); ?>
                    <?php endif; ?>
                    <?php $_incl = $block->displayShippingPriceInclTax($_order); ?>

                    <?= /* @noEscape */ $_excl ?>
                    <?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices($block->getSource()->getStoreId()) && $_incl != $_excl) : ?>
                        (<?= $block->escapeHtml(__('Incl. Tax')) ?> <?= /* @noEscape */ $_incl ?>)
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <?php endif; ?>
        </div>
    </section>

    <div id="creditmemo_item_container">
        <?= $block->getChildHtml('order_items') ?>
    </div>
</form>
