mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 00:20:03 +00:00
More PHP8.4 updates
This commit is contained in:
@@ -119,10 +119,10 @@ class TransactionSummarizer
|
||||
];
|
||||
|
||||
if ('positive' === $method) {
|
||||
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->positive($amount));
|
||||
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->positive($amount));
|
||||
}
|
||||
if ('negative' === $method) {
|
||||
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->negative($amount));
|
||||
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], (string) app('steam')->negative($amount));
|
||||
}
|
||||
|
||||
// then process foreign amount, if it exists.
|
||||
@@ -138,10 +138,10 @@ class TransactionSummarizer
|
||||
];
|
||||
|
||||
if ('positive' === $method) {
|
||||
$array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], app('steam')->positive($amount));
|
||||
$array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], (string) app('steam')->positive($amount));
|
||||
}
|
||||
if ('negative' === $method) {
|
||||
$array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], app('steam')->negative($amount));
|
||||
$array[$foreignCurrencyId]['sum'] = bcadd($array[$foreignCurrencyId]['sum'], (string) app('steam')->negative($amount));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ class TransactionSummarizer
|
||||
];
|
||||
|
||||
// add the data from the $field to the array.
|
||||
$array[$key]['sum'] = bcadd($array[$key]['sum'], app('steam')->{$method}((string) ($journal[$field] ?? '0'))); // @phpstan-ignore-line
|
||||
$array[$key]['sum'] = bcadd($array[$key]['sum'], (string) app('steam')->{$method}((string) ($journal[$field] ?? '0'))); // @phpstan-ignore-line
|
||||
Log::debug(sprintf('Field for transaction #%d is "%s" (%s). Sum: %s', $journal['transaction_group_id'], $currencyCode, $field, $array[$key]['sum']));
|
||||
|
||||
// also do foreign amount, but only when convertToNative is false (otherwise we have it already)
|
||||
@@ -220,7 +220,7 @@ class TransactionSummarizer
|
||||
'currency_code' => $journal['foreign_currency_code'],
|
||||
'currency_decimal_places' => $journal['foreign_currency_decimal_places'],
|
||||
];
|
||||
$array[$key]['sum'] = bcadd($array[$key]['sum'], app('steam')->{$method}((string) $journal['foreign_amount'])); // @phpstan-ignore-line
|
||||
$array[$key]['sum'] = bcadd($array[$key]['sum'], (string) app('steam')->{$method}((string) $journal['foreign_amount'])); // @phpstan-ignore-line
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user