Skip to content

Commit 94ea9b7

Browse files
committed
ACP2E-3276: Order reports showing the wrong currency symbol
1 parent b7b5fa2 commit 94ea9b7

File tree

1 file changed

+23
-1
lines changed
  • app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer

1 file changed

+23
-1
lines changed

app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Currency.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public function render(DataObject $row)
8282
$rate = $this->getStoreCurrencyRate($currencyCode, $row);
8383
$data = (float) $data * $rate;
8484
$data = sprintf('%f', $data);
85-
return $this->_localeCurrency->getCurrency($currencyCode)->toCurrency($data);
85+
$displayCurrencyCode = $this->getStoreDisplayCurrencyCode($row);
86+
return $this->_localeCurrency->getCurrency($displayCurrencyCode)->toCurrency($data);
8687
}
8788

8889
/**
@@ -110,6 +111,27 @@ private function getAdminCurrencyCode(): string
110111
* @throws NoSuchEntityException
111112
*/
112113
private function getStoreCurrencyCode(DataObject $row): string
114+
{
115+
$catalogPriceScope = $this->getCatalogPriceScope();
116+
$storeId = $this->_request->getParam('store_ids');
117+
if ($catalogPriceScope != 0 && !empty($storeId)) {
118+
$currencyCode = $this->_storeManager->getStore($storeId)->getBaseCurrencyCode();
119+
} elseif ($catalogPriceScope != 0) {
120+
$currencyCode = $this->_currencyLocator->getDefaultCurrency($this->_request);
121+
} else {
122+
$currencyCode = $this->_getCurrencyCode($row);
123+
}
124+
return $currencyCode;
125+
}
126+
127+
/**
128+
* Get store display currency code
129+
*
130+
* @param DataObject $row
131+
* @return string
132+
* @throws NoSuchEntityException
133+
*/
134+
private function getStoreDisplayCurrencyCode(DataObject $row): string
113135
{
114136
$catalogPriceScope = $this->getCatalogPriceScope();
115137
$storeId = $this->_request->getParam('store_ids');

0 commit comments

Comments
 (0)