Skip to content

Commit d6a8eab

Browse files
committed
Merge remote-tracking branch 'firedrakes/bugfixes' into PRS
2 parents d6bb4de + 233bc20 commit d6a8eab

File tree

12 files changed

+44
-825
lines changed

12 files changed

+44
-825
lines changed

app/code/Magento/Analytics/README.md

Lines changed: 18 additions & 773 deletions
Large diffs are not rendered by default.

app/code/Magento/Analytics/view/adminhtml/templates/dashboard/section.phtml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
<div class="dashboard-advanced-reports-content">
1515
<?= $block->escapeHtml(__('Gain new insights and take command of your business\' performance,' .
1616
' using our dynamic product, order, and customer reports tailored to your customer data.')) ?>
17-
<a href="<?= $block->escapeUrl($block->getUrl('analytics/reports/show')) ?>"
18-
target="_blank"
19-
data-index="analytics-service-info-link">
20-
<?= $block->escapeHtml(__('View details')) ?>
21-
</a>
2217
</div>
2318
</div>
2419
<div class="dashboard-advanced-reports-actions">
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_CatalogAnalytics module
22

3-
The Magento_CatalogAnalytics module provides products data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_CatalogAnalytics module configures data definitions for a data collection related to the Catalog module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_CustomerAnalytics module
22

3-
The Magento_CustomerAnalytics module provides customers data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_CustomerAnalytics module configures data definitions for a data collection related to the Customer module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_QuoteAnalytics
22

3-
The Magento_QuoteAnalytics module provides quotes data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_QuoteAnalytics module configures data definitions for a data collection related to the Quote module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_ReviewAnalytics module
22

3-
The Magento_ReviewAnalytics module provides reviews data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_ReviewAnalytics module configures data definitions for a data collection related to the Review module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## Overview
1+
# Magento_SalesAnalytics module
22

3-
The Magento_SalesAnalytics module provides orders data for integration with
4-
[Magento Business Intelligence](https://magento.com/products/business-intelligence).
3+
The Magento_SalesAnalytics module configures data definitions for a data collection related to the Sales module entities to be used in [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html).

app/code/Magento/SalesInventory/Model/Plugin/Order/ReturnToStockInvoice.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ public function afterExecute(
8181
\Magento\Sales\Api\Data\CreditmemoCommentCreationInterface $comment = null,
8282
\Magento\Sales\Api\Data\CreditmemoCreationArgumentsInterface $arguments = null
8383
) {
84-
if ($this->stockConfiguration->isAutoReturnEnabled()) {
85-
return $resultEntityId;
86-
}
87-
8884
$invoice = $this->invoiceRepository->get($invoiceId);
8985
$order = $this->orderRepository->get($invoice->getOrderId());
9086

@@ -95,10 +91,11 @@ public function afterExecute(
9591
) {
9692
$returnToStockItems = $arguments->getExtensionAttributes()->getReturnToStockItems();
9793
}
98-
99-
$creditmemo = $this->creditmemoRepository->get($resultEntityId);
100-
$this->returnProcessor->execute($creditmemo, $order, $returnToStockItems);
101-
94+
$isAutoReturn = $this->stockConfiguration->isAutoReturnEnabled();
95+
if ($isAutoReturn || !empty($returnToStockItems)) {
96+
$creditmemo = $this->creditmemoRepository->get($resultEntityId);
97+
$this->returnProcessor->execute($creditmemo, $order, $returnToStockItems, $isAutoReturn);
98+
}
10299
return $resultEntityId;
103100
}
104101
}

app/code/Magento/SalesInventory/Model/Plugin/Order/ReturnToStockOrder.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ public function afterExecute(
7878
\Magento\Sales\Api\Data\CreditmemoCommentCreationInterface $comment = null,
7979
\Magento\Sales\Api\Data\CreditmemoCreationArgumentsInterface $arguments = null
8080
) {
81-
if ($this->stockConfiguration->isAutoReturnEnabled()) {
82-
return $resultEntityId;
83-
}
84-
8581
$order = $this->orderRepository->get($orderId);
8682

8783
$returnToStockItems = [];
@@ -91,10 +87,11 @@ public function afterExecute(
9187
) {
9288
$returnToStockItems = $arguments->getExtensionAttributes()->getReturnToStockItems();
9389
}
94-
95-
$creditmemo = $this->creditmemoRepository->get($resultEntityId);
96-
$this->returnProcessor->execute($creditmemo, $order, $returnToStockItems);
97-
90+
$isAutoReturn = $this->stockConfiguration->isAutoReturnEnabled();
91+
if ($isAutoReturn || !empty($returnToStockItems)) {
92+
$creditmemo = $this->creditmemoRepository->get($resultEntityId);
93+
$this->returnProcessor->execute($creditmemo, $order, $returnToStockItems, $isAutoReturn);
94+
}
9895
return $resultEntityId;
9996
}
10097
}

app/code/Magento/SalesInventory/Observer/RefundOrderInventoryObserver.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,8 @@ public function execute(EventObserver $observer)
9090
$returnToStockItems[] = $item->getOrderItemId();
9191
}
9292
}
93-
$this->returnProcessor->execute(
94-
$creditmemo,
95-
$order,
96-
$returnToStockItems,
97-
$this->stockConfiguration->isAutoReturnEnabled()
98-
);
93+
if (!empty($returnToStockItems)) {
94+
$this->returnProcessor->execute($creditmemo, $order, $returnToStockItems);
95+
}
9996
}
10097
}

0 commit comments

Comments
 (0)