mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Auto commit for release 'develop' on 2025-02-04
This commit is contained in:
@@ -111,7 +111,8 @@ class Steam
|
||||
'transactions.transaction_currency_id',
|
||||
DB::raw('SUM(transactions.amount) AS sum_of_day'),
|
||||
]
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
$currentBalance = $startBalance;
|
||||
$converter = new ExchangeRateConverter();
|
||||
@@ -134,56 +135,56 @@ class Steam
|
||||
$currentBalance[$entryCurrency->code] = bcadd($sumOfDay, $currentBalance[$entryCurrency->code]);
|
||||
|
||||
// if not convert to native, add the amount to "balance" and "native_balance" alike:
|
||||
if(!$convertToNative) {
|
||||
if (!$convertToNative) {
|
||||
$currentBalance['balance'] = bcadd($currentBalance['balance'], $sumOfDay);
|
||||
$currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $sumOfDay);
|
||||
}
|
||||
// if convert to native add the converted amount to native balance.
|
||||
if($convertToNative) {
|
||||
if ($convertToNative) {
|
||||
$nativeSumOfDay = $converter->convert($entryCurrency, $defaultCurrency, $carbon, $sumOfDay);
|
||||
$currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $nativeSumOfDay);
|
||||
// only add to "balance" if it has the correct currency code (the same as "native")
|
||||
if($defaultCurrency->code === $entryCurrency->code) {
|
||||
if ($defaultCurrency->code === $entryCurrency->code) {
|
||||
$currentBalance['balance'] = bcadd($currentBalance['balance'], $sumOfDay);
|
||||
}
|
||||
}
|
||||
|
||||
// // if convert to native, if NOT convert to native.
|
||||
// if ($convertToNative) {
|
||||
// // convert for this day to native
|
||||
// $currentNative = '0'; // TODO
|
||||
// //$currentBalance['native_balance']
|
||||
//
|
||||
//// Log::debug(sprintf('Amount is %s %s, foreign amount is %s, native amount is %s', $entryCurrency->code, $this->bcround($modified, 2), $this->bcround($foreignModified, 2), $this->bcround($nativeModified, 2)));
|
||||
//// // if the currency is the default currency add to native balance + currency balance
|
||||
//// if ($entry->transaction_currency_id === $defaultCurrency->id) {
|
||||
//// Log::debug('Add amount to native.');
|
||||
//// $currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $modified);
|
||||
//// }
|
||||
////
|
||||
//// // add to native balance.
|
||||
//// if ($entry->foreign_currency_id !== $defaultCurrency->id) {
|
||||
//// // this check is not necessary, because if the foreign currency is the same as the default currency, the native amount is zero.
|
||||
//// // so adding this would mean nothing.
|
||||
//// $currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $nativeModified);
|
||||
//// }
|
||||
//// if ($entry->foreign_currency_id === $defaultCurrency->id) {
|
||||
//// $currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $foreignModified);
|
||||
//// }
|
||||
//// // add to balance if is the same.
|
||||
//// if ($entry->transaction_currency_id === $accountCurrency?->id) {
|
||||
//// $currentBalance['balance'] = bcadd($currentBalance['balance'], $modified);
|
||||
//// }
|
||||
//// // add currency balance
|
||||
//// $currentBalance[$entryCurrency->code] = bcadd($currentBalance[$entryCurrency->code] ?? '0', $modified);
|
||||
// }
|
||||
// if (!$convertToNative) {
|
||||
// Log::debug(sprintf('Amount is %s %s, foreign amount is %s, native amount is %s', $entryCurrency->code, $modified, $foreignModified, $nativeModified));
|
||||
// // add to balance, as expected.
|
||||
// $currentBalance['balance'] = bcadd($currentBalance['balance'] ?? '0', $modified);
|
||||
// // add to GBP, as expected.
|
||||
// $currentBalance[$entryCurrency->code] = bcadd($currentBalance[$entryCurrency->code] ?? '0', $modified);
|
||||
// }
|
||||
// // if convert to native, if NOT convert to native.
|
||||
// if ($convertToNative) {
|
||||
// // convert for this day to native
|
||||
// $currentNative = '0'; // TODO
|
||||
// //$currentBalance['native_balance']
|
||||
//
|
||||
// // Log::debug(sprintf('Amount is %s %s, foreign amount is %s, native amount is %s', $entryCurrency->code, $this->bcround($modified, 2), $this->bcround($foreignModified, 2), $this->bcround($nativeModified, 2)));
|
||||
// // // if the currency is the default currency add to native balance + currency balance
|
||||
// // if ($entry->transaction_currency_id === $defaultCurrency->id) {
|
||||
// // Log::debug('Add amount to native.');
|
||||
// // $currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $modified);
|
||||
// // }
|
||||
// //
|
||||
// // // add to native balance.
|
||||
// // if ($entry->foreign_currency_id !== $defaultCurrency->id) {
|
||||
// // // this check is not necessary, because if the foreign currency is the same as the default currency, the native amount is zero.
|
||||
// // // so adding this would mean nothing.
|
||||
// // $currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $nativeModified);
|
||||
// // }
|
||||
// // if ($entry->foreign_currency_id === $defaultCurrency->id) {
|
||||
// // $currentBalance['native_balance'] = bcadd($currentBalance['native_balance'], $foreignModified);
|
||||
// // }
|
||||
// // // add to balance if is the same.
|
||||
// // if ($entry->transaction_currency_id === $accountCurrency?->id) {
|
||||
// // $currentBalance['balance'] = bcadd($currentBalance['balance'], $modified);
|
||||
// // }
|
||||
// // // add currency balance
|
||||
// // $currentBalance[$entryCurrency->code] = bcadd($currentBalance[$entryCurrency->code] ?? '0', $modified);
|
||||
// }
|
||||
// if (!$convertToNative) {
|
||||
// Log::debug(sprintf('Amount is %s %s, foreign amount is %s, native amount is %s', $entryCurrency->code, $modified, $foreignModified, $nativeModified));
|
||||
// // add to balance, as expected.
|
||||
// $currentBalance['balance'] = bcadd($currentBalance['balance'] ?? '0', $modified);
|
||||
// // add to GBP, as expected.
|
||||
// $currentBalance[$entryCurrency->code] = bcadd($currentBalance[$entryCurrency->code] ?? '0', $modified);
|
||||
// }
|
||||
|
||||
$balances[$carbon->format('Y-m-d')] = $currentBalance;
|
||||
Log::debug('Updated entry', $currentBalance);
|
||||
@@ -329,7 +330,7 @@ class Steam
|
||||
$hasCurrency = null !== $accountCurrency;
|
||||
$currency = $hasCurrency ? $accountCurrency : $native;
|
||||
$return = [
|
||||
//'balance' => '0',
|
||||
// 'balance' => '0',
|
||||
'native_balance' => '0',
|
||||
];
|
||||
// balance(s) in other (all) currencies.
|
||||
@@ -343,7 +344,7 @@ class Steam
|
||||
Log::debug('All balances are (joined)', $others);
|
||||
// if there is no request to convert, take this as "balance" and "native_balance".
|
||||
if (!$convertToNative) {
|
||||
//$return['balance'] = $others[$currency->code] ?? '0';
|
||||
// $return['balance'] = $others[$currency->code] ?? '0';
|
||||
$return['native_balance'] = $others[$currency->code] ?? '0';
|
||||
Log::debug(sprintf('Set balance + native_balance to %s', $return['native_balance']));
|
||||
}
|
||||
@@ -356,8 +357,8 @@ class Steam
|
||||
|
||||
// either way, the balance is always combined with the virtual balance:
|
||||
$virtualBalance = (string) ('' === (string) $account->virtual_balance ? '0' : $account->virtual_balance);
|
||||
//$return['balance'] = bcadd($return['balance'], $virtualBalance);
|
||||
//Log::debug(sprintf('Virtual balance makes the total %s', $return['balance']));
|
||||
// $return['balance'] = bcadd($return['balance'], $virtualBalance);
|
||||
// Log::debug(sprintf('Virtual balance makes the total %s', $return['balance']));
|
||||
|
||||
if ($convertToNative) {
|
||||
// the native balance is combined with a converted virtual_balance:
|
||||
|
12
changelog.md
12
changelog.md
@@ -7,12 +7,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Fixed
|
||||
|
||||
- #9713
|
||||
- #9736
|
||||
- #9745
|
||||
- #9747
|
||||
- #9751
|
||||
- #9762
|
||||
- [Issue 9713](https://github.com/firefly-iii/firefly-iii/issues/9713) (Many decimal points in amounts) reported by @memo-567
|
||||
- [Issue 9736](https://github.com/firefly-iii/firefly-iii/issues/9736) (Wrong `finalAccountBalance` result) reported by @gthbusrr
|
||||
- [Issue 9745](https://github.com/firefly-iii/firefly-iii/issues/9745) (Type mismatch in period overview) reported by @electrofloat
|
||||
- [Issue 9747](https://github.com/firefly-iii/firefly-iii/issues/9747) (Data entry issues with exchange rates) reported by @Azmodeszer
|
||||
- [Issue 9751](https://github.com/firefly-iii/firefly-iii/issues/9751) (Net worth changes since 6.2 update) reported by @ahmaddxb
|
||||
- [Issue 9762](https://github.com/firefly-iii/firefly-iii/issues/9762) (Piggy bank show: start/target date not displayed) reported by @Simeam
|
||||
|
||||
## 6.2.2 - 2025-02-02
|
||||
|
||||
|
Reference in New Issue
Block a user