James Cole 2024-01-18 18:57:23 +01:00
parent 44df07a5f5
commit 7ea112c5e7
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
2 changed files with 7 additions and 2 deletions

View File

@ -122,7 +122,7 @@ SESSION_DRIVER=file
# If you use Docker or similar, you can set REDIS_HOST_FILE, REDIS_PASSWORD_FILE or
# REDIS_PORT_FILE to set the value from a file instead of from an environment variable
# can be tcp, unix or http
# can be tcp or unix. http is not supported
REDIS_SCHEME=tcp
# use only when using 'unix' for REDIS_SCHEME. Leave empty otherwise.

View File

@ -71,7 +71,6 @@ class EnableCurrencies extends Command
$found = [$defaultCurrency->id];
// get all meta entries
/** @var Collection $meta */
$meta = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id')
->where('accounts.user_group_id', $userGroup->id)
->where('account_meta.name', 'currency_id')->groupBy('data')->get(['data'])
@ -108,6 +107,12 @@ class EnableCurrencies extends Command
$found[] = $entry->transaction_currency_id;
}
// also get all currencies already enabled.
$alreadyEnabled = $userGroup->currencies()->get(['transaction_currencies.id'])->pluck('id')->toArray();
foreach ($alreadyEnabled as $currencyId) {
$found[] = $currencyId;
}
$found = array_values(array_unique($found));
$found = array_values(
array_filter(