Refactor currency repository.

This commit is contained in:
James Cole
2023-10-28 06:58:33 +02:00
parent 9e94b9e57e
commit 1d138eed8d
42 changed files with 676 additions and 818 deletions

View File

@@ -129,7 +129,7 @@ class AccountCurrencies extends Command
$accounts = $this->accountRepos->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
// get user's currency preference:
$defaultCurrency = app('amount')->getDefaultCurrencyByUser($user);
$defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($user->userGroup);
/** @var Account $account */
foreach ($accounts as $account) {

View File

@@ -77,7 +77,7 @@ class BudgetLimitCurrency extends Command
if (null !== $budget) {
$user = $budget->user;
if (null !== $user) {
$currency = app('amount')->getDefaultCurrencyByUser($user);
$currency = app('amount')->getDefaultCurrencyByUserGroup($user->userGroup);
$budgetLimit->transaction_currency_id = $currency->id;
$budgetLimit->save();
$this->friendlyInfo(