Rename many references from native to primary.

This commit is contained in:
James Cole
2025-07-31 20:24:19 +02:00
parent 210bd83bd4
commit 6d3f2bd5e7
59 changed files with 128 additions and 146 deletions

View File

@@ -84,8 +84,8 @@ abstract class Controller extends BaseController
$this->parameters = $this->getParameters();
if (auth()->check()) {
$language = Steam::getLanguage();
$this->convertToNative = Amount::convertToNative();
$this->nativeCurrency = Amount::getNativeCurrency();
$this->convertToNative = Amount::convertToPrimary();
$this->nativeCurrency = Amount::getPrimaryCurrency();
app()->setLocale($language);
}

View File

@@ -69,8 +69,8 @@ class BillController extends Controller
$bills = $request->getBills();
$start = $request->getStart();
$end = $request->getEnd();
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
$response = [];
// get all bills:
@@ -132,8 +132,8 @@ class BillController extends Controller
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
$response = [];
// collect all expenses in this period (regardless of type) by the given bills and accounts.

View File

@@ -47,8 +47,8 @@ class PeriodController extends Controller
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
// collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class);

View File

@@ -68,8 +68,8 @@ class TagController extends Controller
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);

View File

@@ -46,8 +46,8 @@ class PeriodController extends Controller
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
// collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class);

View File

@@ -68,8 +68,8 @@ class TagController extends Controller
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);

View File

@@ -46,8 +46,8 @@ class PeriodController extends Controller
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
// collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class);

View File

@@ -66,8 +66,8 @@ class TagController extends Controller
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
// collect all expenses in this period (regardless of type) by the given bills and accounts.

View File

@@ -127,8 +127,8 @@ class BasicController extends Controller
{
Log::debug('getBalanceInformation');
// some config settings
$convertToNative = Amount::convertToNative();
$default = Amount::getNativeCurrency();
$convertToNative = Amount::convertToPrimary();
$default = Amount::getPrimaryCurrency();
// prep some arrays:
$sums = [];
$return = [];

View File

@@ -55,7 +55,7 @@ class AccountController extends Controller
$userGroup = $this->validateUserGroup($request);
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUserGroup($userGroup);
$this->default = app('amount')->getNativeCurrency();
$this->default = app('amount')->getPrimaryCurrency();
$this->converter = app(ExchangeRateConverter::class);
return $next($request);

View File

@@ -58,7 +58,7 @@ class AccountController extends Controller
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUserGroup($this->validateUserGroup($request));
$this->chartData = new ChartData();
$this->default = app('amount')->getNativeCurrency();
$this->default = app('amount')->getPrimaryCurrency();
return $next($request);
}

View File

@@ -62,7 +62,7 @@ class BalanceController extends Controller
$this->repository->setUserGroup($userGroup);
$this->collector->setUserGroup($userGroup);
$this->chartData = new ChartData();
// $this->default = app('amount')->getNativeCurrency();
// $this->default = app('amount')->getPrimaryCurrency();
return $next($request);
}
@@ -87,7 +87,7 @@ class BalanceController extends Controller
// prepare for currency conversion and data collection:
/** @var TransactionCurrency $default */
$default = app('amount')->getNativeCurrency();
$default = app('amount')->getPrimaryCurrency();
// get journals for entire period:

View File

@@ -63,7 +63,7 @@ class BudgetController extends Controller
$this->repository = app(BudgetRepositoryInterface::class);
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->currency = app('amount')->getNativeCurrency();
$this->currency = app('amount')->getPrimaryCurrency();
$userGroup = $this->validateUserGroup($request);
$this->repository->setUserGroup($userGroup);
$this->opsRepository->setUserGroup($userGroup);

View File

@@ -82,7 +82,7 @@ class CategoryController extends Controller
/** @var Carbon $end */
$end = $this->parameters->get('end');
$accounts = $this->accountRepos->getAccountsByType([AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value]);
$default = app('amount')->getNativeCurrency();
$default = app('amount')->getPrimaryCurrency();
$converter = new ExchangeRateConverter();
$currencies = [];
$return = [];

View File

@@ -119,7 +119,7 @@ class BasicController extends Controller
private function getBalanceInformation(Carbon $start, Carbon $end): array
{
$object = new SummaryBalanceGrouped();
$default = app('amount')->getNativeCurrency();
$default = app('amount')->getPrimaryCurrency();
$object->setDefault($default);
@@ -234,7 +234,7 @@ class BasicController extends Controller
$available = $this->abRepository->getAvailableBudgetWithCurrency($start, $end);
$budgets = $this->budgetRepository->getActiveBudgets();
$spent = $this->opsRepository->listExpenses($start, $end, null, $budgets);
$default = app('amount')->getNativeCurrency();
$default = app('amount')->getPrimaryCurrency();
$currencies = [];
$converter = new ExchangeRateConverter();