Skip to content

Commit 7063e2a

Browse files
authored
Merge pull request #4626 from magento-trigger/MC-19061_revert
- Revert ticket MC-17003
2 parents d525030 + 7d3042f commit 7063e2a

File tree

8 files changed

+10
-139
lines changed

8 files changed

+10
-139
lines changed

app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,4 @@ public function getShippingLabel()
111111
}
112112
return $label;
113113
}
114-
115-
/**
116-
* Get update totals url.
117-
*
118-
* @return string
119-
*/
120-
public function getUpdateTotalsUrl(): string
121-
{
122-
return $this->getUrl(
123-
'sales/*/updateQty',
124-
[
125-
'order_id' => $this->getSource()->getOrderId(),
126-
'invoice_id' => $this->getRequest()->getParam('invoice_id', null),
127-
]
128-
);
129-
}
130114
}

app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,7 @@ protected function _prepareLayout()
5656
$this->addChild(
5757
'update_button',
5858
\Magento\Backend\Block\Widget\Button::class,
59-
['label' => __('Update Qty\'s'), 'class' => 'update-button secondary', 'onclick' => $onclick]
60-
);
61-
$this->addChild(
62-
'update_totals_button',
63-
\Magento\Backend\Block\Widget\Button::class,
64-
['label' => __('Update Totals'), 'class' => 'update-totals-button secondary', 'onclick' => $onclick]
59+
['label' => __('Update Qty\'s'), 'class' => 'update-button', 'onclick' => $onclick]
6560
);
6661

6762
if ($this->getCreditmemo()->canRefund()) {
@@ -181,16 +176,6 @@ public function getUpdateButtonHtml()
181176
return $this->getChildHtml('update_button');
182177
}
183178

184-
/**
185-
* Get update totals button html
186-
*
187-
* @return string
188-
*/
189-
public function getUpdateTotalsButtonHtml(): string
190-
{
191-
return $this->getChildHtml('update_totals_button');
192-
}
193-
194179
/**
195180
* Get update url
196181
*

app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<testCaseId value="MC-18159"/>
1919
<useCaseId value="MC-17003"/>
2020
<group value="sales"/>
21+
<skip>
22+
<issueId value="MC-17003"/>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<!--Create product-->

app/code/Magento/Sales/view/adminhtml/templates/order/creditmemo/create/items.phtml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
<span class="title"><?= $block->escapeHtml(__('Refund Totals')) ?></span>
101101
</div>
102102
<?= $block->getChildHtml('creditmemo_totals') ?>
103-
<div class="totals-actions"><?= $block->getUpdateTotalsButtonHtml() ?></div>
104103
<div class="order-totals-actions">
105104
<div class="field choice admin__field admin__field-option field-append-comments">
106105
<input id="notify_customer"
@@ -140,9 +139,8 @@ require(['jquery'], function(jQuery){
140139

141140
//<![CDATA[
142141
var submitButtons = jQuery('.submit-button');
143-
var updateButtons = jQuery('.update-button,.update-totals-button');
144-
var fields = jQuery('.qty-input,.order-subtotal-table input[type="text"]');
145-
142+
var updateButtons = jQuery('.update-button');
143+
var fields = jQuery('.qty-input');
146144
function enableButtons(buttons) {
147145
buttons.removeClass('disabled').prop('disabled', false);
148146
}

app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<description value="Watermark images should be able to be uploaded in the admin"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-5796"/>
19+
<skip>
20+
<issueId value="MC-18496"/>
21+
</skip>
1922
<group value="Watermark"/>
2023
</annotations>
2124
<before>

app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/order/_total.less

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
}
2323
}
2424

25-
.totals-actions {
26-
text-align: right;
27-
}
28-
2925
.order-totals-actions {
3026
margin-top: @indent__s;
3127
.actions {

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Totals.php

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,6 @@ class Totals extends \Magento\Sales\Test\Block\Adminhtml\Order\Totals
2727
*/
2828
protected $capture = '[name="invoice[capture_case]"]';
2929

30-
/**
31-
* Refund Shipping css selector.
32-
*
33-
* @var string
34-
*/
35-
private $refundShippingSelector = '#shipping_amount';
36-
37-
/**
38-
* Adjustment Refund css selector.
39-
*
40-
* @var string
41-
*/
42-
private $adjustmentRefundSelector = '#adjustment_positive';
43-
44-
/**
45-
* Adjustment Fee css selector.
46-
*
47-
* @var string
48-
*/
49-
private $adjustmentFeeSelector = '#adjustment_negative';
50-
51-
/**
52-
* Update Totals button css selector.
53-
*
54-
* @var string
55-
*/
56-
private $updateTotalsSelector = '.update-totals-button';
57-
5830
/**
5931
* Submit invoice.
6032
*
@@ -85,44 +57,4 @@ public function setCaptureOption($option)
8557
{
8658
$this->_rootElement->find($this->capture, Locator::SELECTOR_CSS, 'select')->setValue($option);
8759
}
88-
89-
/**
90-
* Get Refund Shipping input element.
91-
*
92-
* @return \Magento\Mtf\Client\ElementInterface
93-
*/
94-
public function getRefundShippingElement()
95-
{
96-
return $this->_rootElement->find($this->refundShippingSelector, Locator::SELECTOR_CSS);
97-
}
98-
99-
/**
100-
* Get Adjustment Refund input element.
101-
*
102-
* @return \Magento\Mtf\Client\ElementInterface
103-
*/
104-
public function getAdjustmentRefundElement()
105-
{
106-
return $this->_rootElement->find($this->adjustmentRefundSelector, Locator::SELECTOR_CSS);
107-
}
108-
109-
/**
110-
* Get Adjustment Fee input element.
111-
*
112-
* @return \Magento\Mtf\Client\ElementInterface
113-
*/
114-
public function getAdjustmentFeeElement()
115-
{
116-
return $this->_rootElement->find($this->adjustmentFeeSelector, Locator::SELECTOR_CSS);
117-
}
118-
119-
/**
120-
* Click update totals button.
121-
*
122-
* @return void
123-
*/
124-
public function clickUpdateTotals()
125-
{
126-
$this->_rootElement->find($this->updateTotalsSelector)->click();
127-
}
12860
}

dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/CreateCreditMemoStep.php

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@ public function run()
9595
if ($this->compare($items, $refundData)) {
9696
$this->orderCreditMemoNew->getFormBlock()->updateQty();
9797
}
98-
$hasChangeTotals = $this->isTotalsDataChanged($refundData);
99-
$this->orderCreditMemoNew->getFormBlock()->fillFormData($refundData);
100-
if ($hasChangeTotals) {
101-
$this->orderCreditMemoNew->getTotalsBlock()->clickUpdateTotals();
102-
}
10398

99+
$this->orderCreditMemoNew->getFormBlock()->fillFormData($refundData);
104100
$this->orderCreditMemoNew->getFormBlock()->submit();
105101
}
106102

@@ -120,30 +116,4 @@ protected function getCreditMemoIds()
120116
$this->salesOrderView->getOrderForm()->openTab('creditmemos');
121117
return $this->salesOrderView->getOrderForm()->getTab('creditmemos')->getGridBlock()->getIds();
122118
}
123-
124-
/**
125-
* Is totals data changed.
126-
*
127-
* @param array $data
128-
* @return bool
129-
*/
130-
private function isTotalsDataChanged(array $data): bool
131-
{
132-
$compareData = [
133-
'shipping_amount' =>
134-
$this->orderCreditMemoNew->getTotalsBlock()->getRefundShippingElement()->getValue(),
135-
'adjustment_positive' =>
136-
$this->orderCreditMemoNew->getTotalsBlock()->getAdjustmentRefundElement()->getValue(),
137-
'adjustment_negative' =>
138-
$this->orderCreditMemoNew->getTotalsBlock()->getAdjustmentFeeElement()->getValue(),
139-
];
140-
141-
foreach ($compareData as $fieldName => $fieldValue) {
142-
if (isset($data['form_data'][$fieldName]) && $fieldValue != $data['form_data'][$fieldName]) {
143-
return true;
144-
}
145-
}
146-
147-
return false;
148-
}
149119
}

0 commit comments

Comments
 (0)