<?php
/**
 * Maho
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Form $this */
?>
<form id="edit_form" method="post" action="<?= $this->getSaveUrl() ?>">
    <?= $this->getBlockHtml('formkey') ?>
    <?php  $_order = $this->getCreditmemo()->getOrder() ?>
    <?= $this->getChildHtml('order_info') ?>

    <?php if (!$_order->getIsVirtual()): ?>
    <div class="box-left">
    <?php else: ?>
    <div class="box-right">
    <?php endif ?>
        <!--Billing Address-->
        <div class="entry-edit">
            <div class="entry-edit-head">
                <h4><?= Mage::helper('sales')->__('Payment Information') ?></h4>
            </div>
            <fieldset>
                <div><?= $this->getChildHtml('order_payment') ?></div>
                <div><?= Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
                <?php /*if ($this->getCreditmemo()->canRefund()): ?>
                <input type="checkbox" name="creditmemo[do_refund]" id="creditmemo_do_refund" value="1" checked/>
                <label for="creditmemo_do_refund" class="normal"><?= Mage::helper('sales')->__('Refund Amount') ?></label>
                <?php endif*/ ?>
            </fieldset>
        </div>
    </div>
    <?php if (!$_order->getIsVirtual()): ?>
    <div class="box-right">
        <!--Shipping Address-->
        <div class="entry-edit">
            <div class="entry-edit-head">
                <h4><?= Mage::helper('sales')->__('Shipping Information') ?></h4>
            </div>
            <fieldset>
                <strong><?= $this->escapeHtml($_order->getShippingDescription()) ?></strong>
                <?= $this->helper('sales')->__('Total Shipping Charges') ?>:

                <?php if ($this->helper('tax')->displaySalesPriceInclTax($this->getSource()->getStoreId())): ?>
                    <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
                <?php else: ?>
                    <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
                <?php endif ?>
                <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>

                <?= $_excl ?>
                <?php if ($this->helper('tax')->displaySalesBothPrices($this->getSource()->getStoreId()) && $_incl != $_excl): ?>
                    (<?= $this->__('Incl. Tax') ?> <?= $_incl ?>)
                <?php endif ?>
            </fieldset>
        </div>
    </div>
    <?php endif ?>
    <div class="clear"></div>

    <div class="entry-edit">
      <div class="entry-edit-head">
          <h4><?= Mage::helper('sales')->__('Items to Refund') ?></h4>
      </div>
    </div>
    <div id="creditmemo_item_container">
      <?= $this->getChildHtml('order_items') ?>
    </div>
</form>
