[chore] Move to native from default. [skip ci]

This commit is contained in:
James Cole
2025-01-19 11:54:40 +01:00
parent 19dfcf7139
commit bd1f8b2497
34 changed files with 47 additions and 47 deletions

View File

@@ -233,7 +233,7 @@ trait AccountServiceTrait
// get or grab currency:
$currency = $this->accountRepository->getAccountCurrency($account);
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
$currency = app('amount')->getNativeCurrencyByUserGroup($account->user->userGroup);
}
// submit to factory:
@@ -351,7 +351,7 @@ trait AccountServiceTrait
if (null === $currency) {
// use default currency:
$currency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup);
$currency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
}
$currency->enabled = true;
$currency->save();
@@ -391,7 +391,7 @@ trait AccountServiceTrait
// if exists, update:
$currency = $this->accountRepository->getAccountCurrency($account);
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
$currency = app('amount')->getNativeCurrencyByUserGroup($account->user->userGroup);
}
// simply grab the first journal and change it:
@@ -457,7 +457,7 @@ trait AccountServiceTrait
// get or grab currency:
$currency = $this->accountRepository->getAccountCurrency($account);
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
$currency = app('amount')->getNativeCurrencyByUserGroup($account->user->userGroup);
}
// submit to factory:
@@ -573,7 +573,7 @@ trait AccountServiceTrait
// if exists, update:
$currency = $this->accountRepository->getAccountCurrency($account);
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
$currency = app('amount')->getNativeCurrencyByUserGroup($account->user->userGroup);
}
// simply grab the first journal and change it:
@@ -654,7 +654,7 @@ trait AccountServiceTrait
// get or grab currency:
$currency = $this->accountRepository->getAccountCurrency($account);
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
$currency = app('amount')->getNativeCurrencyByUserGroup($account->user->userGroup);
}
// submit to factory:

View File

@@ -107,7 +107,7 @@ trait RecurringTransactionTrait
$currency = $factory->find($array['currency_id'] ?? null, $array['currency_code'] ?? null);
$foreignCurrency = $factory->find($array['foreign_currency_id'] ?? null, $array['foreign_currency_code'] ?? null);
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUserGroup($recurrence->user->userGroup);
$currency = app('amount')->getNativeCurrencyByUserGroup($recurrence->user->userGroup);
}
app('log')->debug(

View File

@@ -55,7 +55,7 @@ class BillUpdateService
if (array_key_exists('currency_id', $data) || array_key_exists('currency_code', $data)) {
$factory = app(TransactionCurrencyFactory::class);
$currency = $factory->find((int) ($data['currency_id'] ?? null), $data['currency_code'] ?? null) ??
app('amount')->getDefaultCurrencyByUserGroup($bill->user->userGroup);
app('amount')->getNativeCurrencyByUserGroup($bill->user->userGroup);
// enable the currency if it isn't.
$currency->enabled = true;