Auto commit for release 'branch-v6.2' on 2024-12-25

This commit is contained in:
github-actions
2024-12-25 07:13:41 +01:00
parent e73fe06f7e
commit e8cc321898
28 changed files with 713 additions and 626 deletions

View File

@@ -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;

View File

@@ -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) {