mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-03 12:47:17 -06:00
Add savings total for savings widget on dashboard
This commit is contained in:
parent
8f9b1b866b
commit
c587081fe4
@ -8,6 +8,7 @@ use Input;
|
||||
use Preferences;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use Steam;
|
||||
|
||||
/**
|
||||
* Class HomeController
|
||||
@ -60,6 +61,11 @@ class HomeController extends Controller
|
||||
$accounts = $repository->getFrontpageAccounts($frontPage);
|
||||
$savings = $repository->getSavingsAccounts();
|
||||
|
||||
$savingsTotal = 0;
|
||||
foreach ($savings as $savingAccount) {
|
||||
$savingsTotal += Steam::balance($savingAccount);
|
||||
}
|
||||
|
||||
// check if all books are correct.
|
||||
$sum = $repository->sumOfEverything();
|
||||
if ($sum != 0) {
|
||||
@ -77,7 +83,7 @@ class HomeController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions'));
|
||||
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,6 +55,7 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-line-chart"></i> Savings
|
||||
<span class="pull-right">{!! Amount::format($savingsTotal) !!}</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@if(count($savings) == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user