mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
fix currency
This commit is contained in:
@@ -90,11 +90,9 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
throw new Error('Cannot save settings');
|
||||
}
|
||||
|
||||
/** Rebuild for Currency Settings */
|
||||
if (isset($data->baseCurrency) || isset($data->currencyRates)) {
|
||||
if (isset($data->defaultCurrency) || isset($data->baseCurrency) || isset($data->currencyRates)) {
|
||||
$this->getContainer()->get('dataManager')->rebuildDatabase([]);
|
||||
}
|
||||
/** END Rebuild for Currency Settings */
|
||||
|
||||
return $this->getConfigData();
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ class Xlsx extends \Espo\Core\Injectable
|
||||
}
|
||||
} else if ($type == 'currencyConverted') {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$currency = $this->getConfig()->get('baseCurrency');
|
||||
$currency = $this->getConfig()->get('defaultCurrency');
|
||||
$currencySymbol = $this->getMetadata()->get(['app', 'currency', 'symbolMap', $currency], '');
|
||||
|
||||
$sheet->getStyle("$col$rowNumber")
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Schema\rebuildActions;
|
||||
|
||||
class Currency extends \Espo\Core\Utils\Database\Schema\BaseRebuildActions
|
||||
{
|
||||
|
||||
|
||||
@@ -38,7 +38,15 @@ Espo.define('views/settings/fields/currency-rates', 'views/fields/base', functio
|
||||
var rateValues = {};
|
||||
(this.model.get('currencyList') || []).forEach(function (currency) {
|
||||
if (currency != baseCurrency) {
|
||||
rateValues[currency] = currencyRates[currency] || 1.00;
|
||||
rateValues[currency] = currencyRates[currency];
|
||||
if (!rateValues[currency]) {
|
||||
if (currencyRates[baseCurrency]) {
|
||||
rateValues[currency] = Math.round(1 / currencyRates[baseCurrency] * 1000) / 1000;
|
||||
}
|
||||
if (!rateValues[currency]) {
|
||||
rateValues[currency] = 1.00
|
||||
}
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user