Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix #3374
James Coleef9714b7e07f
diff --git a/app/Helpers/Report/NetWorth.php b/app/Helpers/Report/NetWorth.phpindex a906e08619..fc6189ecac 100644--- a/app/Helpers/Report/NetWorth.php+++ b/app/Helpers/Report/NetWorth.php@@ -109,15 +109,13 @@ class NetWorth implements NetWorthInterfaceLog::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';