Started work for piggy banks [skip ci]

This commit is contained in:
James Cole
2014-07-31 15:46:25 +02:00
parent e0ed0cbeb2
commit 50cfcb8905
3 changed files with 13 additions and 11 deletions

View File

@@ -33,9 +33,9 @@ class LimitController extends BaseController
{
$periods = \Config::get('firefly.periods_to_text');
$prefilled = [
'startdate' => Input::get('startdate') ? : date('Y-m-d'),
'startdate' => Input::get('startdate') ? : date('Y-m-d'),
'repeat_freq' => Input::get('repeat_freq') ? : 'monthly',
'budget_id' => $budget ? $budget->id : null
'budget_id' => $budget ? $budget->id : null
];
$budgets = $this->_budgets->getAsSelectList();
@@ -55,13 +55,14 @@ class LimitController extends BaseController
$limit = $this->_limits->find($limitId);
if ($limit) {
$limit->delete();
return Redirect::route('budgets.index');
if (Input::get('from') == 'date') {
return Redirect::route('budgets.index');
} else {
return Redirect::route('budgets.index.budget');
}
} else {
return View::make('error')->with('message', 'No such limit!');
}