|
7 | 7 | // phpcs:disable Magento2.Templates.ThisInTemplate
|
8 | 8 |
|
9 | 9 | /* @var \Magento\Sales\Block\Adminhtml\Order\Creditmemo\View\Form $block */
|
| 10 | +/* @var \Magento\Tax\Helper\Data $helper */ |
| 11 | +/* @var \Magento\Framework\Escaper $escaper */ |
10 | 12 | ?>
|
11 |
| -<?php $_order = $block->getCreditmemo()->getOrder() ?> |
| 13 | + |
| 14 | +<?php $helper = $this->helper(\Magento\Tax\Helper\Data::class); ?> |
| 15 | +<?php $_creditMemo = $block->getCreditmemo(); ?> |
| 16 | +<?php $_order = $_creditMemo->getOrder() ?> |
| 17 | + |
| 18 | +<?php |
| 19 | +$creditMemoStatus = isset($_creditMemo->getStates()[$_creditMemo->getState()]) |
| 20 | + ? $_creditMemo->getStates()[$_creditMemo->getState()] |
| 21 | + : null; |
| 22 | +$memoAdminDate = $block->formatDate($_creditMemo->getCreatedAt(), \IntlDateFormatter::MEDIUM); |
| 23 | +?> |
| 24 | + |
| 25 | +<div class="admin__page-section creditmemo-view-information"> |
| 26 | + <div class="admin__page-section-title"> |
| 27 | + <span class="title"><?= $escaper->escapeHtml(__('Credit Memo Information')) ?></span> |
| 28 | + </div> |
| 29 | + <div class="admin__page-section-content"> |
| 30 | + <div class="admin__page-section-item creditmemo-information"> |
| 31 | + <div class="admin__page-section-item-title"> |
| 32 | + <?php $confirmationEmailStatusMessage = $_creditMemo->getEmailSent() |
| 33 | + ? __('The credit memo confirmation email was sent') |
| 34 | + : __('The credit memo confirmation email is not sent'); |
| 35 | + ?> |
| 36 | + <span class="title"> |
| 37 | + <?= $escaper->escapeHtml(__('Memo # %1', $_creditMemo->getIncrementId())) ?> |
| 38 | + (<span><?= $escaper->escapeHtml($confirmationEmailStatusMessage) ?></span>) |
| 39 | + </span> |
| 40 | + </div> |
| 41 | + <div class="admin__page-section-item-content"> |
| 42 | + <table class="admin__table-secondary creditmemo-information-table"> |
| 43 | + <tr> |
| 44 | + <th><?= $escaper->escapeHtml(__('Credit Memo Date')) ?></th> |
| 45 | + <td><?= $escaper->escapeHtml($memoAdminDate) ?></td> |
| 46 | + </tr> |
| 47 | + <?php if ($creditMemoStatus): ?> |
| 48 | + <tr> |
| 49 | + <th><?= $escaper->escapeHtml(__('Status')) ?></th> |
| 50 | + <td><?= $escaper->escapeHtml($creditMemoStatus) ?></td> |
| 51 | + </tr> |
| 52 | + <?php endif; ?> |
| 53 | + </table> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | +</div> |
| 58 | + |
12 | 59 | <?= $block->getChildHtml('order_info') ?>
|
| 60 | + |
13 | 61 | <section class="admin__page-section">
|
14 | 62 | <div class="admin__page-section-title">
|
15 |
| - <span class="title"><?= $block->escapeHtml(__('Payment & Shipping Method')) ?></span> |
| 63 | + <span class="title"><?= $escaper->escapeHtml(__('Payment & Shipping Method')) ?></span> |
16 | 64 | </div>
|
17 | 65 | <div class="admin__page-section-content">
|
18 | 66 |
|
19 |
| - <?php if (!$_order->getIsVirtual()) : ?> |
| 67 | + <?php if (!$_order->getIsVirtual()): ?> |
20 | 68 | <div class="admin__page-section-item order-payment-method">
|
21 |
| - <?php else : ?> |
| 69 | + <?php else: ?> |
22 | 70 | <div class="admin__page-section-item order-payment-method order-payment-method-virtual">
|
23 | 71 | <?php endif; ?>
|
24 | 72 | <?php /* Billing Address */?>
|
25 | 73 | <div class="admin__page-section-item-title">
|
26 |
| - <span class="title"><?= $block->escapeHtml(__('Payment Information')) ?></span> |
| 74 | + <span class="title"><?= $escaper->escapeHtml(__('Payment Information')) ?></span> |
27 | 75 | </div>
|
28 | 76 | <div class="admin__page-section-item-content">
|
29 | 77 | <div class="order-payment-method-title"><?= $block->getChildHtml('order_payment') ?></div>
|
30 |
| - <div class="order-payment-currency"><?= $block->escapeHtml(__('The order was placed using %1.', $_order->getOrderCurrencyCode())) ?></div> |
| 78 | + <div class="order-payment-currency"> |
| 79 | + <?= $escaper->escapeHtml( |
| 80 | + __('The order was placed using %1.', $_order->getOrderCurrencyCode()) |
| 81 | + ); ?> |
| 82 | + </div> |
31 | 83 | <div class="order-payment-additional"><?= $block->getChildHtml('order_payment_additional') ?></div>
|
32 | 84 | </div>
|
33 | 85 | </div>
|
34 | 86 |
|
35 |
| - <?php if (!$_order->getIsVirtual()) : ?> |
| 87 | + <?php if (!$_order->getIsVirtual()): ?> |
36 | 88 | <div class="admin__page-section-item order-shipping-address">
|
37 | 89 | <?php /* Shipping Address */ ?>
|
38 | 90 | <div class="admin__page-section-item-title">
|
39 |
| - <span class="title"><?= $block->escapeHtml(__('Shipping Information')) ?></span> |
| 91 | + <span class="title"><?= $escaper->escapeHtml(__('Shipping Information')) ?></span> |
40 | 92 | </div>
|
41 | 93 | <div class="shipping-description-wrapper admin__page-section-item-content">
|
42 |
| - <div class="shipping-description-title"><?= $block->escapeHtml($_order->getShippingDescription()) ?></div> |
| 94 | + <div class="shipping-description-title"> |
| 95 | + <?= $escaper->escapeHtml($_order->getShippingDescription()) ?> |
| 96 | + </div> |
43 | 97 | <div class="shipping-description-content">
|
44 |
| - <?= $block->escapeHtml(__('Total Shipping Charges')) ?>: |
| 98 | + <?= $escaper->escapeHtml(__('Total Shipping Charges')) ?>: |
45 | 99 |
|
46 |
| - <?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displayShippingPriceIncludingTax()) : ?> |
| 100 | + <?php if ($helper->displayShippingPriceIncludingTax()): ?> |
47 | 101 | <?php $_excl = $block->displayShippingPriceInclTax($_order); ?>
|
48 |
| - <?php else : ?> |
| 102 | + <?php else: ?> |
49 | 103 | <?php $_excl = $block->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
50 | 104 | <?php endif; ?>
|
51 | 105 | <?php $_incl = $block->displayShippingPriceInclTax($_order); ?>
|
52 | 106 |
|
53 | 107 | <?= /* @noEscape */ $_excl ?>
|
54 |
| - <?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displayShippingBothPrices() && $_incl != $_excl) : ?> |
55 |
| - (<?= $block->escapeHtml(__('Incl. Tax')) ?> <?= /* @noEscape */ $_incl ?>) |
| 108 | + <?php if ($helper->displayShippingBothPrices() && $_incl != $_excl): ?> |
| 109 | + (<?= $escaper->escapeHtml(__('Incl. Tax')) ?> <?= /* @noEscape */ $_incl ?>) |
56 | 110 | <?php endif; ?>
|
57 | 111 | </div>
|
58 | 112 | </div>
|
59 | 113 | </div>
|
60 | 114 | <?php endif; ?>
|
61 | 115 | </div>
|
62 | 116 | </section>
|
63 |
| -<?php $_items = $block->getCreditmemo()->getAllItems() ?> |
64 | 117 |
|
65 |
| -<?php if (count($_items)) : ?> |
66 |
| -<div id="creditmemo_items_container"> |
67 |
| - <?= $block->getChildHtml('creditmemo_items') ?> |
68 |
| -</div> |
69 |
| -<?php else : ?> |
70 |
| -<section class="admin__page-section"> |
71 |
| - <div class="admin__page-section-title"> |
72 |
| - <span class="title"><?= $block->escapeHtml(__('Items Refunded')) ?></span> |
| 118 | +<?php $_items = $block->getCreditmemo()->getAllItems() ?> |
| 119 | +<?php if (count($_items)): ?> |
| 120 | + <div id="creditmemo_items_container"> |
| 121 | + <?= $block->getChildHtml('creditmemo_items') ?> |
73 | 122 | </div>
|
74 |
| - <div class="no-items admin__page-section-content"><?= $block->escapeHtml(__('No Items')) ?></div> |
75 |
| -</section> |
| 123 | +<?php else: ?> |
| 124 | + <section class="admin__page-section"> |
| 125 | + <div class="admin__page-section-title"> |
| 126 | + <span class="title"><?= $escaper->escapeHtml(__('Items Refunded')) ?></span> |
| 127 | + </div> |
| 128 | + <div class="no-items admin__page-section-content"><?= $escaper->escapeHtml(__('No Items')) ?></div> |
| 129 | + </section> |
76 | 130 | <?php endif; ?>
|
77 | 131 |
|
78 | 132 | <section class="admin__page-section">
|
79 | 133 | <div class="admin__page-section-title">
|
80 |
| - <span class="title"><?= $block->escapeHtml(__('Memo Total')) ?></span> |
| 134 | + <span class="title"><?= $escaper->escapeHtml(__('Memo Total')) ?></span> |
81 | 135 | </div>
|
82 | 136 | <div class="admin__page-section-content">
|
83 | 137 | <div class="admin__page-section-item order-comments-history">
|
84 | 138 | <div class="admin__page-section-item-title">
|
85 |
| - <span class="title"><?= $block->escapeHtml(__('Credit Memo History')) ?></span> |
| 139 | + <span class="title"><?= $escaper->escapeHtml(__('Credit Memo History')) ?></span> |
86 | 140 | </div>
|
87 | 141 | <div class="admin__page-section-item-content"><?= $block->getChildHtml('order_comments') ?></div>
|
88 | 142 | </div>
|
89 | 143 | <div class="admin__page-section-item order-totals" id="history_form">
|
90 | 144 | <div class="admin__page-section-item-title">
|
91 |
| - <span class="title"><?= $block->escapeHtml(__('Credit Memo Totals')) ?></span> |
| 145 | + <span class="title"><?= $escaper->escapeHtml(__('Credit Memo Totals')) ?></span> |
92 | 146 | </div>
|
93 | 147 | <div class="admin__page-section-content"><?= $block->getChildHtml('creditmemo_totals') ?></div>
|
94 | 148 | </div>
|
|
0 commit comments