mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Rename many references from native to primary.
This commit is contained in:
@@ -52,7 +52,7 @@ class AmountFormat extends AbstractExtension
|
||||
return new TwigFilter(
|
||||
'formatAmount',
|
||||
static function (string $string): string {
|
||||
$currency = app('amount')->getNativeCurrency();
|
||||
$currency = app('amount')->getPrimaryCurrency();
|
||||
|
||||
return app('amount')->formatAnything($currency, $string, true);
|
||||
},
|
||||
@@ -65,7 +65,7 @@ class AmountFormat extends AbstractExtension
|
||||
return new TwigFilter(
|
||||
'formatAmountPlain',
|
||||
static function (string $string): string {
|
||||
$currency = app('amount')->getNativeCurrency();
|
||||
$currency = app('amount')->getPrimaryCurrency();
|
||||
|
||||
return app('amount')->formatAnything($currency, $string, false);
|
||||
},
|
||||
@@ -98,7 +98,7 @@ class AmountFormat extends AbstractExtension
|
||||
|
||||
/** @var AccountRepositoryInterface $accountRepos */
|
||||
$accountRepos = app(AccountRepositoryInterface::class);
|
||||
$currency = $accountRepos->getAccountCurrency($account) ?? app('amount')->getNativeCurrency();
|
||||
$currency = $accountRepos->getAccountCurrency($account) ?? app('amount')->getPrimaryCurrency();
|
||||
|
||||
return app('amount')->formatAnything($currency, $amount, $coloured);
|
||||
},
|
||||
@@ -157,7 +157,7 @@ class AmountFormat extends AbstractExtension
|
||||
$currency = TransactionCurrency::whereCode($code)->first();
|
||||
if (null === $currency) {
|
||||
Log::error(sprintf('Could not find currency with code "%s". Fallback to native currency.', $code));
|
||||
$currency = Amount::getNativeCurrency();
|
||||
$currency = Amount::getPrimaryCurrency();
|
||||
Log::error(sprintf('Fallback currency is "%s".', $currency->code));
|
||||
}
|
||||
|
||||
|
@@ -75,8 +75,8 @@ class General extends AbstractExtension
|
||||
Log::debug(sprintf('twig balance: Call finalAccountBalance with date/time "%s"', $date->toIso8601String()));
|
||||
$info = Steam::finalAccountBalance($account, $date);
|
||||
$currency = Steam::getAccountCurrency($account);
|
||||
$default = Amount::getNativeCurrency();
|
||||
$convertToNative = Amount::convertToNative();
|
||||
$default = Amount::getPrimaryCurrency();
|
||||
$convertToNative = Amount::convertToPrimary();
|
||||
$useNative = $convertToNative && $default->id !== $currency->id;
|
||||
$currency ??= $default;
|
||||
$strings = [];
|
||||
|
Reference in New Issue
Block a user