mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 18:25:00 -06:00
Fix #3374
This commit is contained in:
parent
8d20029557
commit
ef9714b7e0
@ -109,15 +109,13 @@ class NetWorth implements NetWorthInterface
|
||||
|
||||
Log::debug(sprintf('Balance is %s', $balance));
|
||||
|
||||
// if the account is a credit card, subtract the virtual balance from the balance,
|
||||
// to better reflect that this is not money that is actually "yours".
|
||||
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
|
||||
// always subtract virtual balance.
|
||||
$virtualBalance = (string) $account->virtual_balance;
|
||||
if ('ccAsset' === $role && '' !== $virtualBalance && (float) $virtualBalance > 0) {
|
||||
if ('' !== $virtualBalance) {
|
||||
$balance = bcsub($balance, $virtualBalance);
|
||||
}
|
||||
|
||||
Log::debug(sprintf('Balance corrected to %s', $balance));
|
||||
Log::debug(sprintf('Balance corrected to %s because of virtual balance (%s)', $balance, $virtualBalance));
|
||||
|
||||
if (!isset($netWorth[$currencyId])) {
|
||||
$netWorth[$currencyId] = '0';
|
||||
|
Loading…
Reference in New Issue
Block a user