diff --git a/src/QUI/ERP/Currency/Handler.php b/src/QUI/ERP/Currency/Handler.php index 6d8f77c81cda96a1a3d2dd3c4abcdc6dc2b141e0..5108e30a3b259f20a31e199253d4d84eb0a1c64f 100644 --- a/src/QUI/ERP/Currency/Handler.php +++ b/src/QUI/ERP/Currency/Handler.php @@ -297,20 +297,24 @@ public static function getUserCurrencyByCountry($User = null): ?Currency * Return all allowed currencies * * @return Currency[] - [Currency, Currency, Currency] - * @throws QUI\Exception */ public static function getAllowedCurrencies(): array { - $Config = QUI::getPackage('quiqqer/currency')->getConfig(); - $allowed = $Config->getValue('currency', 'allowedCurrencies'); + try { + $Config = QUI::getPackage('quiqqer/currency')->getConfig(); + $allowed = $Config->getValue('currency', 'allowedCurrencies'); - $allowed = explode(',', trim($allowed)); - $list = []; + $allowed = explode(',', trim($allowed)); + $list = []; - $default = self::getDefaultCurrency()->getCode(); + $default = self::getDefaultCurrency()->getCode(); - if (!in_array($default, $allowed)) { - $allowed[] = $default; + if (!in_array($default, $allowed)) { + $allowed[] = $default; + } + } catch (QUI\Exception $e) { + QUI\System\Log::addError($e->getMessage()); + return []; } foreach ($allowed as $currency) { @@ -579,7 +583,7 @@ public static function getCurrencyTypes(): array ]; } } catch (QUI\Exception $Exception) { - QUI\System\Log::writeException($Exception); + QUI\System\Log::addNotice($Exception->getMessage()); } }