Can no longer set currency of expense / revenue accounts.

This commit is contained in:
James Cole
2022-10-23 14:46:26 +02:00
parent a91f6fbfaf
commit abdb717b37
4 changed files with 35 additions and 2 deletions

View File

@@ -486,6 +486,13 @@ class AccountRepository implements AccountRepositoryInterface
*/
public function getAccountCurrency(Account $account): ?TransactionCurrency
{
$type = $account->accountType->type;
$list = config('firefly.valid_currency_account_types');
// return null if not in this list.
if(!in_array($type, $list, true)) {
return null;
}
$currencyId = (int) $this->getMetaValue($account, 'currency_id');
if ($currencyId > 0) {
return TransactionCurrency::find($currencyId);