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
@ -62,7 +62,7 @@ class PiggybankController extends BaseController
|
||||
View::share('mainTitleIcon', 'fa-sort-amount-asc');
|
||||
|
||||
return View::make('piggybanks.create-piggybank')->with('accounts', $accounts)
|
||||
->with('periods', $periods);
|
||||
->with('periods', $periods);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,14 +148,14 @@ class PiggybankController extends BaseController
|
||||
View::share('mainTitleIcon', 'fa-rotate-left');
|
||||
|
||||
return View::make('piggybanks.edit-repeated')->with('piggybank', $piggyBank)->with('accounts', $accounts)
|
||||
->with('periods', $periods);
|
||||
->with('periods', $periods);
|
||||
} else {
|
||||
// piggy bank.
|
||||
View::share('title', 'Piggy banks');
|
||||
View::share('mainTitleIcon', 'fa-sort-amount-asc');
|
||||
|
||||
return View::make('piggybanks.edit-piggybank')->with('piggybank', $piggyBank)->with('accounts', $accounts)
|
||||
->with('periods', $periods);
|
||||
->with('periods', $periods);
|
||||
}
|
||||
|
||||
|
||||
@ -196,11 +196,11 @@ class PiggybankController extends BaseController
|
||||
}
|
||||
break;
|
||||
}
|
||||
if($piggyBank->repeats == 1) {
|
||||
$route = 'piggybanks.index.repeated';
|
||||
if ($piggyBank->repeats == 1) {
|
||||
$route = 'piggybanks.index.repeated';
|
||||
|
||||
} else {
|
||||
$route = 'piggybanks.index.piggybanks';
|
||||
$route = 'piggybanks.index.piggybanks';
|
||||
}
|
||||
return Redirect::route($route);
|
||||
}
|
||||
@ -225,7 +225,15 @@ class PiggybankController extends BaseController
|
||||
$id = $account->id;
|
||||
if (!isset($accounts[$id])) {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,9 +242,9 @@ class PiggybankController extends BaseController
|
||||
View::share('mainTitleIcon', 'fa-sort-amount-asc');
|
||||
|
||||
return View::make('piggybanks.index')->with('piggybanks', $piggybanks)
|
||||
->with('countRepeating', $countRepeating)
|
||||
->with('countNonRepeating', $countNonRepeating)
|
||||
->with('accounts', $accounts);
|
||||
->with('countRepeating', $countRepeating)
|
||||
->with('countNonRepeating', $countNonRepeating)
|
||||
->with('accounts', $accounts);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -285,9 +293,9 @@ class PiggybankController extends BaseController
|
||||
|
||||
|
||||
return View::make('piggybanks.index')->with('piggybanks', $piggybanks)
|
||||
->with('countRepeating', $countRepeating)
|
||||
->with('countNonRepeating', $countNonRepeating)
|
||||
->with('accounts', $accounts);
|
||||
->with('countRepeating', $countRepeating)
|
||||
->with('countNonRepeating', $countNonRepeating)
|
||||
->with('accounts', $accounts);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -311,7 +319,7 @@ class PiggybankController extends BaseController
|
||||
}
|
||||
|
||||
return View::make('piggybanks.show')->with('piggyBank', $piggyBank)->with('leftOnAccount', $leftOnAccount)
|
||||
->with('balance', $balance);
|
||||
->with('balance', $balance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,17 +186,23 @@
|
||||
|
||||
--}}
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-12">
|
||||
<h4>Account information</h4>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Account</th>
|
||||
<th>Left for piggy banks</th>
|
||||
<th>Total planned savings</th>
|
||||
<th>Saved so far</th>
|
||||
<th>Left to save</th>
|
||||
</tr>
|
||||
@foreach($accounts as $account)
|
||||
<tr>
|
||||
<td>{{{$account['account']->name}}}</td>
|
||||
<td>{{mf($account['left'])}}</td>
|
||||
<td>{{mf($account['tosave'])}}</td>
|
||||
<td>{{mf($account['saved'])}}</td>
|
||||
<td>{{mf($account['tosave']-$account['saved'])}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
Loading…
Reference in New Issue
Block a user