James Cole
2024-07-31 20:31:52 +02:00
parent dafd99f155
commit 5af0219884

View File

@@ -84,6 +84,14 @@ class CurrencyRepository implements CurrencyRepositoryInterface
return 'account_meta'; 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: // is being used in bills:
$bills = Bill::where('transaction_currency_id', $currency->id)->count(); $bills = Bill::where('transaction_currency_id', $currency->id)->count();
if ($bills > 0) { if ($bills > 0) {