mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Auto commit for release 'branch-v6.2' on 2024-12-25
This commit is contained in:
@@ -75,7 +75,7 @@ class AmountFormat extends AbstractExtension
|
||||
$this->formatAmountByAccount(),
|
||||
$this->formatAmountBySymbol(),
|
||||
$this->formatAmountByCurrency(),
|
||||
$this->formatAmountByCode()
|
||||
$this->formatAmountByCode(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ class AmountFormat extends AbstractExtension
|
||||
'formatAmountByCode',
|
||||
static function (string $amount, string $code, ?bool $coloured = null): string {
|
||||
$coloured ??= true;
|
||||
|
||||
/** @var TransactionCurrency $currency */
|
||||
$currency = TransactionCurrency::whereCode($code)->first();
|
||||
|
||||
@@ -128,8 +129,8 @@ class AmountFormat extends AbstractExtension
|
||||
return new TwigFunction(
|
||||
'formatAmountBySymbol',
|
||||
static function (string $amount, string $symbol, ?int $decimalPlaces = null, ?bool $coloured = null): string {
|
||||
$decimalPlaces ??= 2;
|
||||
$coloured ??= true;
|
||||
$decimalPlaces ??= 2;
|
||||
$coloured ??= true;
|
||||
$currency = new TransactionCurrency();
|
||||
$currency->symbol = $symbol;
|
||||
$currency->decimal_places = $decimalPlaces;
|
||||
|
@@ -69,9 +69,9 @@ class General extends AbstractExtension
|
||||
$date = session('end', today(config('app.timezone'))->endOfMonth());
|
||||
$info = Steam::finalAccountBalance($account, $date);
|
||||
$currency = Steam::getAccountCurrency($account);
|
||||
$default = Amount::getDefaultCurrency();
|
||||
$default = Amount::getDefaultCurrency();
|
||||
$convertToNative = app('preferences')->get('convert_to_native', false)->data;
|
||||
$useNative = $convertToNative && $default->id !== $currency->id;
|
||||
$useNative = $convertToNative && $default->id !== $currency->id;
|
||||
$strings = [];
|
||||
foreach ($info as $key => $balance) {
|
||||
if ('balance' === $key) {
|
||||
@@ -79,6 +79,7 @@ class General extends AbstractExtension
|
||||
if (!$useNative) {
|
||||
$strings[] = app('amount')->formatAnything($currency, $balance, false);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
if ('native_balance' === $key) {
|
||||
|
Reference in New Issue
Block a user