mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Fix a bug where the balance routine forgot to account for accounts without a currency preference.
This commit is contained in:
@@ -127,6 +127,7 @@ class AccountController extends Controller
|
||||
$chartData[$account->name] = $diff;
|
||||
}
|
||||
}
|
||||
|
||||
arsort($chartData);
|
||||
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
||||
$cache->store($data);
|
||||
|
@@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support;
|
||||
|
||||
use Amount;
|
||||
use Carbon\Carbon;
|
||||
use Crypt;
|
||||
use DB;
|
||||
@@ -47,6 +48,11 @@ class Steam
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
}
|
||||
$currencyId = intval($account->getMeta('currency_id'));
|
||||
// if null, use system default currency:
|
||||
if ($currencyId === 0) {
|
||||
$currency = Amount::getDefaultCurrency();
|
||||
$currencyId = $currency->id;
|
||||
}
|
||||
// first part: get all balances in own currency:
|
||||
$nativeBalance = strval(
|
||||
$account->transactions()
|
||||
|
Reference in New Issue
Block a user