diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepository.php b/app/Repositories/UserGroups/Currency/CurrencyRepository.php index 5f66f4dd0d..147829355a 100644 --- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php +++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php @@ -84,6 +84,14 @@ class CurrencyRepository implements CurrencyRepositoryInterface return 'account_meta'; } + // second search using integer check. + $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((int)$currency->id))->count(); + if ($meta > 0) { + app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); + + return 'account_meta'; + } + // is being used in bills: $bills = Bill::where('transaction_currency_id', $currency->id)->count(); if ($bills > 0) {