mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some more stats on the piggy banks.
This commit is contained in:
parent
0707603b63
commit
d5e1da5948
@ -196,7 +196,7 @@ class PiggybankController extends BaseController
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if($piggyBank->repeats == 1) {
|
if ($piggyBank->repeats == 1) {
|
||||||
$route = 'piggybanks.index.repeated';
|
$route = 'piggybanks.index.repeated';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -225,7 +225,15 @@ class PiggybankController extends BaseController
|
|||||||
$id = $account->id;
|
$id = $account->id;
|
||||||
if (!isset($accounts[$id])) {
|
if (!isset($accounts[$id])) {
|
||||||
$account->leftOnAccount = $this->_repository->leftOnAccount($account);
|
$account->leftOnAccount = $this->_repository->leftOnAccount($account);
|
||||||
$accounts[$id] = ['account' => $account, 'left' => $this->_repository->leftOnAccount($account)];
|
$accounts[$id] = [
|
||||||
|
'account' => $account,
|
||||||
|
'left' => $this->_repository->leftOnAccount($account),
|
||||||
|
'tosave' => $piggybank->targetamount,
|
||||||
|
'saved' => $piggybank->currentRelevantRep()->currentamount
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$accounts[$id]['tosave'] += $piggybank->targetamount;
|
||||||
|
$accounts[$id]['saved'] += $piggybank->currentRelevantRep()->currentamount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,17 +186,23 @@
|
|||||||
|
|
||||||
--}}
|
--}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-12">
|
||||||
<h4>Account information</h4>
|
<h4>Account information</h4>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Account</th>
|
<th>Account</th>
|
||||||
<th>Left for piggy banks</th>
|
<th>Left for piggy banks</th>
|
||||||
|
<th>Total planned savings</th>
|
||||||
|
<th>Saved so far</th>
|
||||||
|
<th>Left to save</th>
|
||||||
</tr>
|
</tr>
|
||||||
@foreach($accounts as $account)
|
@foreach($accounts as $account)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{{$account['account']->name}}}</td>
|
<td>{{{$account['account']->name}}}</td>
|
||||||
<td>{{mf($account['left'])}}</td>
|
<td>{{mf($account['left'])}}</td>
|
||||||
|
<td>{{mf($account['tosave'])}}</td>
|
||||||
|
<td>{{mf($account['saved'])}}</td>
|
||||||
|
<td>{{mf($account['tosave']-$account['saved'])}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user