Skip to content

Firefly III: a personal finances manager

Fix for #3154

James Cole542c64154cff
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index ea26e766e0..4e6829fffc 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -76,8 +76,15 @@ class Steam
->where('transactions.transaction_currency_id', '!=', $currency->id)
->sum('transactions.foreign_amount');
+ // check:
+ Log::debug(sprintf('Steam::balance. Native balance is "%s"', $nativeBalance));
+ Log::debug(sprintf('Steam::balance. Foreign balance is "%s"', $foreignBalance));
+
$balance = bcadd($nativeBalance, $foreignBalance);
$virtual = null === $account->virtual_balance ? '0' : (string)$account->virtual_balance;
+
+ Log::debug(sprintf('Steam::balance. Virtual balance is "%s"', $virtual));
+
$balance = bcadd($balance, $virtual);
$cache->store($balance);
diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php
index a71bad42be..014c72274c 100644
--- a/app/Support/Twig/General.php
+++ b/app/Support/Twig/General.php
@@ -147,7 +147,7 @@ class General extends AbstractExtension
'balance',
static function (?Account $account): string {
if (null === $account) {
- return 'NULL';
+ return '0';
}
/** @var Carbon $date */
$date = session('end', Carbon::now()->endOfMonth());