Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ebec912
Issue-27474. Added info blocks to order invoice, credit memo and ship…
topanok Aug 23, 2022
ceb2a28
Issue-27474. Changed info.phtml location
topanok Aug 23, 2022
e8c69be
Issue-27474. Changed page titles, order Info::getOrderAdminDate metho…
topanok Aug 25, 2022
928d24d
Issue-27474. Replace $block to $escaper
topanok Aug 25, 2022
398b313
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Aug 25, 2022
dae2b6a
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Aug 26, 2022
2a54300
Issue-27474. Fix tests errors
topanok Aug 26, 2022
e4a77b5
Issue-27474. Fix tests errors(v2)
topanok Aug 26, 2022
32eeb52
Issue-35789. Added noEscape annotation
topanok Aug 26, 2022
96819c3
Issue-35789. Removed class that is not used in any way
topanok Aug 27, 2022
da6db6e
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Aug 27, 2022
832c00d
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Dec 11, 2022
678fe36
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Jan 12, 2023
66891a0
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Jan 12, 2023
e67d670
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Jan 20, 2023
e17487f
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Jan 24, 2023
09eb610
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Jan 31, 2023
d66e369
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Feb 9, 2023
80363f4
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Feb 14, 2023
7e3047b
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Feb 25, 2023
7717708
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Mar 15, 2023
186bae0
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Mar 20, 2023
a9d790f
Merge branch '2.4-develop' into fix-for-issue-27474
engcom-Hotel May 15, 2023
5f419de
Merge branch '2.4-develop' into fix-for-issue-27474
engcom-Hotel May 17, 2023
5c3220a
Merge branch '2.4-develop' into fix-for-issue-27474
topanok May 24, 2023
18bf3f8
Merge branch '2.4-develop' into fix-for-issue-27474
engcom-Echo May 30, 2023
ceda293
Merge branch '2.4-develop' into fix-for-issue-27474
engcom-Echo Jun 28, 2023
99cc417
Automated Test coverage Added
engcom-Echo Jul 3, 2023
e9cadcc
Merge branch '2.4-develop' into fix-for-issue-27474
engcom-Lima Jul 7, 2023
2530e04
Merge branch '2.4-develop' into fix-for-issue-27474
engcom-Lima Jul 10, 2023
424474b
Issue-27474 Removed info blocks and transferred logic from info block…
topanok Aug 1, 2023
0d36655
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Aug 1, 2023
eabcda2
Issue-27474 Code style fix
topanok Aug 2, 2023
6852190
Merge remote-tracking branch 'origin/fix-for-issue-27474' into fix-fo…
topanok Aug 2, 2023
629ae1f
Remove newly created function
engcom-Echo Aug 17, 2023
23e9f52
Merge branch '2.4-develop' into fix-for-issue-27474
engcom-Echo Aug 18, 2023
3fcdfc2
Merge branch '2.4-develop' into fix-for-issue-27474
topanok Aug 21, 2023
55f2a23
Fix functinal test failurs
glo24157 Aug 22, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@
class AbstractOrder extends \Magento\Backend\Block\Widget
{
/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
protected $_coreRegistry = null;

/**
* Admin helper
*
* @var \Magento\Sales\Helper\Admin
*/
protected $_adminHelper;
Expand Down
10 changes: 4 additions & 6 deletions app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class Info extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder
protected $groupRepository;

/**
* Metadata element factory
*
* @var \Magento\Customer\Model\Metadata\ElementFactory
*/
protected $_metadataElementFactory;
Expand Down Expand Up @@ -161,8 +159,7 @@ public function getViewUrl($orderId)
}

/**
* Find sort order for account data
* Sort Order used as array key
* Find sort order for account data. Sort Order used as array key
*
* @param array $data
* @param int $sortOrder
Expand All @@ -178,10 +175,10 @@ protected function _prepareAccountDataSortOrder(array $data, $sortOrder)
}

/**
* Return array of additional account data
* Value is option style array
* Return array of additional account data. Value is option style array
*
* @return array
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getCustomerAccountData()
{
Expand Down Expand Up @@ -286,6 +283,7 @@ public function getTimezoneForStore($store)
*
* @param string $createdAt
* @return \DateTime
* @throws \Exception
*/
public function getOrderAdminDate($createdAt)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class View extends \Magento\Backend\App\Action implements HttpGetActionInterface
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo';
public const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo';

/**
* @var \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader
Expand Down Expand Up @@ -69,10 +69,12 @@ public function execute()
$resultPage->setActiveMenu('Magento_Sales::sales_creditmemo');
if ($creditmemo->getInvoice()) {
$resultPage->getConfig()->getTitle()->prepend(
__("View Memo for #%1", $creditmemo->getInvoice()->getIncrementId())
__("View Credit Memo for #%1", $creditmemo->getInvoice()->getIncrementId())
);
} else {
$resultPage->getConfig()->getTitle()->prepend(__("View Memo"));
$resultPage->getConfig()->getTitle()->prepend(
__('View Credit Memo #%1', $creditmemo->getIncrementId())
);
}
return $resultPage;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function execute()
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Magento_Sales::sales_order');
$resultPage->getConfig()->getTitle()->prepend(__('Invoices'));
$resultPage->getConfig()->getTitle()->prepend(sprintf("#%s", $invoice->getIncrementId()));
$resultPage->getConfig()->getTitle()->prepend(__('View Invoice #%1', $invoice->getIncrementId()));
$resultPage->getLayout()->getBlock(
'sales_invoice_view'
)->updateBackButtonUrl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@
<element name="customerEmail" type="text" selector=".order-account-information table tr:nth-of-type(2) > td a"/>
<element name="customerGroup" type="text" selector=".order-account-information table tr:nth-of-type(3) > td"/>
<element name="invoiceNoteComment" type="text" selector="div.note-list-comment"/>
<element name="sendEmail" type="button" selector=".send-email"/>
<element name="invoiceTitle" type="text" selector=".invoice-information .title"/>
</section>
</sections>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminInvoiceOrderInvoiceEmailSentTest" extends="AdminInvoiceOrderTest">
<annotations>
<features value="Sales"/>
<stories value="Create an Invoice via the Admin and send email see confirmation"/>
<title value="Admin should be able to see confirmation message Of invoice email"/>
<description value="Admin should be able to see confirmation message Of invoice email"/>
<severity value="MAJOR"/>
<testCaseId value="git-36030"/>
<group value="sales"/>
<group value="cloud"/>
</annotations>
<remove keyForRemoval="checkIfOrderStatusIsProcessing"/>
<click selector="{{AdminInvoiceOrderInformationSection.sendEmail}}" stepKey="clickSendEmail"/>
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmationSendEmail"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmSendEmail" />
<grabTextFrom selector="{{AdminInvoiceOrderInformationSection.invoiceTitle}}" stepKey="grabTitle"/>
<assertStringContainsString stepKey="assertSendEmailConfirmation">
<actualResult type="const">$grabTitle</actualResult>
<expectedResult type="string">The invoice confirmation email was sent</expectedResult>
</assertStringContainsString>
</test>
</tests>
14 changes: 12 additions & 2 deletions app/code/Magento/Sales/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ Sales,Sales
"You created the credit memo.","You created the credit memo."
"We can't save the credit memo right now.","We can't save the credit memo right now."
"We can't update the item's quantity right now.","We can't update the item's quantity right now."
"View Memo for #%1","View Memo for #%1"
"View Memo","View Memo"
"View Credit Memo for #%1","View Credit Memo for #%1"
"View Credit Memo #%1","View Credit Memo #%1"
"You voided the credit memo.","You voided the credit memo."
"We can't void the credit memo.","We can't void the credit memo."
"The order no longer exists.","The order no longer exists."
Expand Down Expand Up @@ -807,6 +807,16 @@ If set YES Email field will be required during Admin order creation for new Cust
"The coupon code has been removed.","The coupon code has been removed."
"This creditmemo no longer exists.","This creditmemo no longer exists."
"Add to address book","Add to address book"
"View Invoice # %1","View Invoice # %1"
"Invoice Information","Invoice Information"
"The invoice confirmation email was sent","The invoice confirmation email was sent"
"The invoice confirmation email is not sent","The invoice confirmation email is not sent"
"Invoice # %1","Invoice # %1"
"Credit Memo Information","Credit Memo Information"
"The credit memo confirmation email was sent","The credit memo confirmation email was sent"
"The credit memo confirmation email is not sent","The credit memo confirmation email is not sent"
"Memo # %1","Memo # %1"
"Credit Memo Date","Credit Memo Date"
"Logo for PDF Print-outs","Logo for PDF Print-outs"
"Please provide a comment text or update the order status to be able to submit a comment for this order.", "Please provide a comment text or update the order status to be able to submit a comment for this order."
"A status change or comment text is required to submit a comment.", "A status change or comment text is required to submit a comment."
Original file line number Diff line number Diff line change
Expand Up @@ -7,88 +7,142 @@
// phpcs:disable Magento2.Templates.ThisInTemplate

/* @var \Magento\Sales\Block\Adminhtml\Order\Creditmemo\View\Form $block */
/* @var \Magento\Tax\Helper\Data $helper */
/* @var \Magento\Framework\Escaper $escaper */
?>
<?php $_order = $block->getCreditmemo()->getOrder() ?>

<?php $helper = $this->helper(\Magento\Tax\Helper\Data::class); ?>
<?php $_creditMemo = $block->getCreditmemo(); ?>
<?php $_order = $_creditMemo->getOrder() ?>

<?php
$creditMemoStatus = isset($_creditMemo->getStates()[$_creditMemo->getState()])
? $_creditMemo->getStates()[$_creditMemo->getState()]
: null;
$memoAdminDate = $block->formatDate($_creditMemo->getCreatedAt(), \IntlDateFormatter::MEDIUM);
?>

<div class="admin__page-section creditmemo-view-information">
<div class="admin__page-section-title">
<span class="title"><?= $escaper->escapeHtml(__('Credit Memo Information')) ?></span>
</div>
<div class="admin__page-section-content">
<div class="admin__page-section-item creditmemo-information">
<div class="admin__page-section-item-title">
<?php $confirmationEmailStatusMessage = $_creditMemo->getEmailSent()
? __('The credit memo confirmation email was sent')
: __('The credit memo confirmation email is not sent');
?>
<span class="title">
<?= $escaper->escapeHtml(__('Memo # %1', $_creditMemo->getIncrementId())) ?>
(<span><?= $escaper->escapeHtml($confirmationEmailStatusMessage) ?></span>)
</span>
</div>
<div class="admin__page-section-item-content">
<table class="admin__table-secondary creditmemo-information-table">
<tr>
<th><?= $escaper->escapeHtml(__('Credit Memo Date')) ?></th>
<td><?= $escaper->escapeHtml($memoAdminDate) ?></td>
</tr>
<?php if ($creditMemoStatus): ?>
<tr>
<th><?= $escaper->escapeHtml(__('Status')) ?></th>
<td><?= $escaper->escapeHtml($creditMemoStatus) ?></td>
</tr>
<?php endif; ?>
</table>
</div>
</div>
</div>
</div>

<?= $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>
<span class="title"><?= $escaper->escapeHtml(__('Payment &amp; Shipping Method')) ?></span>
</div>
<div class="admin__page-section-content">

<?php if (!$_order->getIsVirtual()) : ?>
<?php if (!$_order->getIsVirtual()): ?>
<div class="admin__page-section-item order-payment-method">
<?php else : ?>
<?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>
<span class="title"><?= $escaper->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-currency">
<?= $escaper->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()) : ?>
<?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>
<span class="title"><?= $escaper->escapeHtml(__('Shipping Information')) ?></span>
</div>
<div class="shipping-description-wrapper admin__page-section-item-content">
<div class="shipping-description-title"><?= $block->escapeHtml($_order->getShippingDescription()) ?></div>
<div class="shipping-description-title">
<?= $escaper->escapeHtml($_order->getShippingDescription()) ?>
</div>
<div class="shipping-description-content">
<?= $block->escapeHtml(__('Total Shipping Charges')) ?>:
<?= $escaper->escapeHtml(__('Total Shipping Charges')) ?>:

<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displayShippingPriceIncludingTax()) : ?>
<?php if ($helper->displayShippingPriceIncludingTax()): ?>
<?php $_excl = $block->displayShippingPriceInclTax($_order); ?>
<?php else : ?>
<?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)->displayShippingBothPrices() && $_incl != $_excl) : ?>
(<?= $block->escapeHtml(__('Incl. Tax')) ?> <?= /* @noEscape */ $_incl ?>)
<?php if ($helper->displayShippingBothPrices() && $_incl != $_excl): ?>
(<?= $escaper->escapeHtml(__('Incl. Tax')) ?> <?= /* @noEscape */ $_incl ?>)
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
</section>
<?php $_items = $block->getCreditmemo()->getAllItems() ?>

<?php if (count($_items)) : ?>
<div id="creditmemo_items_container">
<?= $block->getChildHtml('creditmemo_items') ?>
</div>
<?php else : ?>
<section class="admin__page-section">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Items Refunded')) ?></span>
<?php $_items = $block->getCreditmemo()->getAllItems() ?>
<?php if (count($_items)): ?>
<div id="creditmemo_items_container">
<?= $block->getChildHtml('creditmemo_items') ?>
</div>
<div class="no-items admin__page-section-content"><?= $block->escapeHtml(__('No Items')) ?></div>
</section>
<?php else: ?>
<section class="admin__page-section">
<div class="admin__page-section-title">
<span class="title"><?= $escaper->escapeHtml(__('Items Refunded')) ?></span>
</div>
<div class="no-items admin__page-section-content"><?= $escaper->escapeHtml(__('No Items')) ?></div>
</section>
<?php endif; ?>

<section class="admin__page-section">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Memo Total')) ?></span>
<span class="title"><?= $escaper->escapeHtml(__('Memo Total')) ?></span>
</div>
<div class="admin__page-section-content">
<div class="admin__page-section-item order-comments-history">
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Credit Memo History')) ?></span>
<span class="title"><?= $escaper->escapeHtml(__('Credit Memo History')) ?></span>
</div>
<div class="admin__page-section-item-content"><?= $block->getChildHtml('order_comments') ?></div>
</div>
<div class="admin__page-section-item order-totals" id="history_form">
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Credit Memo Totals')) ?></span>
<span class="title"><?= $escaper->escapeHtml(__('Credit Memo Totals')) ?></span>
</div>
<div class="admin__page-section-content"><?= $block->getChildHtml('creditmemo_totals') ?></div>
</div>
Expand Down
Loading