Rename "native" to "primary".

This commit is contained in:
James Cole
2025-08-01 06:12:36 +02:00
parent ea6addafe6
commit 084ce02c21
51 changed files with 296 additions and 296 deletions

View File

@@ -105,7 +105,7 @@ class CreateController extends Controller
$request->session()->flash(
'preFilled',
[
'currency_id' => $this->defaultCurrency->id,
'currency_id' => $this->primaryCurrency->id,
'include_net_worth' => $hasOldInput ? (bool) $request->old('include_net_worth') : true,
]
);

View File

@@ -125,7 +125,7 @@ class EditController extends Controller
$openingBalanceAmount = '';
}
$openingBalanceDate = $repository->getOpeningBalanceDate($account);
$currency = $this->repository->getAccountCurrency($account) ?? $this->defaultCurrency;
$currency = $this->repository->getAccountCurrency($account) ?? $this->primaryCurrency;
// include this account in net-worth charts?
$includeNetWorth = $repository->getMetaValue($account, 'include_net_worth');

View File

@@ -104,14 +104,14 @@ class IndexController extends Controller
function (Account $account) use ($activities, $startBalances, $endBalances): void {
$currency = $this->repository->getAccountCurrency($account);
$account->lastActivityDate = $this->isInArrayDate($activities, $account->id);
$account->startBalances = Steam::filterAccountBalance($startBalances[$account->id] ?? [], $account, $this->convertToNative, $currency);
$account->endBalances = Steam::filterAccountBalance($endBalances[$account->id] ?? [], $account, $this->convertToNative, $currency);
$account->startBalances = Steam::filterAccountBalance($startBalances[$account->id] ?? [], $account, $this->convertToPrimary, $currency);
$account->endBalances = Steam::filterAccountBalance($endBalances[$account->id] ?? [], $account, $this->convertToPrimary, $currency);
$account->differences = $this->subtract($account->startBalances, $account->endBalances);
$account->interest = Steam::bcround($this->repository->getMetaValue($account, 'interest'), 4);
$account->interestPeriod = (string) trans(sprintf('firefly.interest_calc_%s', $this->repository->getMetaValue($account, 'interest_period')));
$account->accountTypeString = (string) trans(sprintf('firefly.account_type_%s', $account->accountType->type));
$account->current_debt = '0';
$account->currency = $currency ?? $this->defaultCurrency;
$account->currency = $currency ?? $this->primaryCurrency;
$account->iban = implode(' ', str_split((string) $account->iban, 4));
}
);
@@ -183,8 +183,8 @@ class IndexController extends Controller
$interest = '' === $interest ? '0' : $interest;
$currency = $this->repository->getAccountCurrency($account);
$account->startBalances = Steam::filterAccountBalance($startBalances[$account->id] ?? [], $account, $this->convertToNative, $currency);
$account->endBalances = Steam::filterAccountBalance($endBalances[$account->id] ?? [], $account, $this->convertToNative, $currency);
$account->startBalances = Steam::filterAccountBalance($startBalances[$account->id] ?? [], $account, $this->convertToPrimary, $currency);
$account->endBalances = Steam::filterAccountBalance($endBalances[$account->id] ?? [], $account, $this->convertToPrimary, $currency);
$account->differences = $this->subtract($account->startBalances, $account->endBalances);
$account->lastActivityDate = $this->isInArrayDate($activities, $account->id);
$account->interest = Steam::bcround($interest, 4);
@@ -195,7 +195,7 @@ class IndexController extends Controller
$account->location = $this->repository->getLocation($account);
$account->liability_direction = $this->repository->getMetaValue($account, 'liability_direction');
$account->current_debt = $this->repository->getMetaValue($account, 'current_debt') ?? '-';
$account->currency = $currency ?? $this->defaultCurrency;
$account->currency = $currency ?? $this->primaryCurrency;
$account->iban = implode(' ', str_split((string) $account->iban, 4));

View File

@@ -87,7 +87,7 @@ class ReconcileController extends Controller
return redirect(route('accounts.index', [config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type))]));
}
$currency = $this->accountRepos->getAccountCurrency($account) ?? $this->defaultCurrency;
$currency = $this->accountRepos->getAccountCurrency($account) ?? $this->primaryCurrency;
// no start or end:
$range = app('navigation')->getViewRange(false);
@@ -204,7 +204,7 @@ class ReconcileController extends Controller
}
$reconciliation = $this->accountRepos->getReconciliation($account);
$currency = $this->accountRepos->getAccountCurrency($account) ?? $this->defaultCurrency;
$currency = $this->accountRepos->getAccountCurrency($account) ?? $this->primaryCurrency;
$source = $reconciliation;
$destination = $account;
if (1 === bccomp($difference, '0')) {

View File

@@ -108,7 +108,7 @@ class ShowController extends Controller
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$accountCurrency = $this->repository->getAccountCurrency($account);
$currency = $accountCurrency ?? $this->defaultCurrency;
$currency = $accountCurrency ?? $this->primaryCurrency;
$fStart = $start->isoFormat($this->monthAndDayFormat);
$fEnd = $end->isoFormat($this->monthAndDayFormat);
$subTitle = (string) trans('firefly.journals_in_period_for_account', ['name' => $account->name, 'start' => $fStart, 'end' => $fEnd]);
@@ -165,7 +165,7 @@ class ShowController extends Controller
}
Log::debug(sprintf('show: Call finalAccountBalance with date/time "%s"', $now->toIso8601String()));
$balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $now), $account, $this->convertToNative, $accountCurrency);
$balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $now), $account, $this->convertToPrimary, $accountCurrency);
return view(
'accounts.show',
@@ -212,7 +212,7 @@ class ShowController extends Controller
$subTitleIcon = config('firefly.subIconsByIdentifier.'.$account->accountType->type);
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$currency = $this->repository->getAccountCurrency($account) ?? $this->defaultCurrency;
$currency = $this->repository->getAccountCurrency($account) ?? $this->primaryCurrency;
$subTitle = (string) trans('firefly.all_journals_for_account', ['name' => $account->name]);
$periods = new Collection();
@@ -232,7 +232,7 @@ class ShowController extends Controller
$showAll = true;
// correct
Log::debug(sprintf('showAll: Call finalAccountBalance with date/time "%s"', $end->toIso8601String()));
$balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $end), $account, $this->convertToNative, $accountCurrency);
$balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $end), $account, $this->convertToPrimary, $accountCurrency);
return view(
'accounts.show',