Rename method.

This commit is contained in:
James Cole
2025-07-31 20:17:46 +02:00
parent 65a926874b
commit 210bd83bd4
39 changed files with 61 additions and 61 deletions

View File

@@ -271,7 +271,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
$factory = app(TransactionCurrencyFactory::class);
$currency = $factory->find($data['currency_id'] ?? null, $data['currency_code'] ?? null);
if (null === $currency) {
$currency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
$currency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup);
}
$currency->enabled = true;
$currency->save();
@@ -369,7 +369,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
}
// catch unexpected null:
if (null === $currency) {
$currency = $budgetLimit->transactionCurrency ?? app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
$currency = $budgetLimit->transactionCurrency ?? app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup);
}
$currency->enabled = true;
$currency->save();

View File

@@ -391,7 +391,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
$autoBudget = $this->getAutoBudget($budget);
// grab default currency:
$currency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
$currency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup);
if (!$autoBudget instanceof AutoBudget) {
// at this point it's a blind assumption auto_budget_type is 1 or 2.
@@ -776,7 +776,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
$currency = $repos->findByCode((string) $data['currency_code']);
}
if (null === $currency) {
$currency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
$currency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup);
}
$autoBudget = new AutoBudget();

View File

@@ -143,7 +143,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
// if needs conversion to native.
$convertToNative = Amount::convertToNative($this->user);
$nativeCurrency = Amount::getNativeCurrencyByUserGroup($this->userGroup);
$nativeCurrency = Amount::getPrimaryCurrencyByUserGroup($this->userGroup);
$currencyId = (int) $nativeCurrency->id;
$currencyCode = $nativeCurrency->code;
$currencyName = $nativeCurrency->name;