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