Skip to content

EspoCRM – Open Source CRM Application

fix default currency

Yuri Kuznetsovd00af77206ba
diff --git a/application/Espo/Core/Record/Defaults/DefaultPopulator.php b/application/Espo/Core/Record/Defaults/DefaultPopulator.php
index 1a6b9384cc..0f2536a25b 100644
--- a/application/Espo/Core/Record/Defaults/DefaultPopulator.php
+++ b/application/Espo/Core/Record/Defaults/DefaultPopulator.php
@@ -148,8 +148,10 @@ class DefaultPopulator implements Populator
continue;
}
- if ($entity->get($field) && !$entity->get($field . 'Currency')) {
- $entity->set($field . 'Currency', $this->currencyConfig->getDefaultCurrency());
+ $currencyAttribute = $field . 'Currency';
+
+ if ($entity->get($field) !== null && !$entity->get($currencyAttribute)) {
+ $entity->set($currencyAttribute, $this->currencyConfig->getDefaultCurrency());
}
}
}