diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 8e10e9f830..ba394611ae 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -382,7 +382,7 @@ class AccountController extends BaseController if ($data['post_submit_action'] == 'create_another') { return Redirect::route('accounts.edit', $account->id); } else { - return Redirect::route('accounts.edit', $account->id); + return Redirect::route('accounts.index',$data['what']); } case 'validate_only': $messageBags = $acct->validate($data); diff --git a/app/controllers/BudgetController.php b/app/controllers/BudgetController.php index 74ed304099..26c1b3ead2 100644 --- a/app/controllers/BudgetController.php +++ b/app/controllers/BudgetController.php @@ -335,12 +335,12 @@ class BudgetController extends BaseController } // store! $repos->update($budget, $data); - Session::flash('success', 'Account updated!'); + Session::flash('success', 'Budget updated!'); if ($data['post_submit_action'] == 'create_another') { return Redirect::route('budgets.edit', $budget->id); } else { - return Redirect::route('budgets.edit', $budget->id); + return Redirect::route('budgets.index'); } case 'validate_only': $messageBags = $repos->validate($data); diff --git a/app/lib/FireflyIII/Database/Budget.php b/app/lib/FireflyIII/Database/Budget.php index 7d82420abb..ba8d22fcf4 100644 --- a/app/lib/FireflyIII/Database/Budget.php +++ b/app/lib/FireflyIII/Database/Budget.php @@ -91,10 +91,13 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface } else { $errors->add('name', 'Name is mandatory'); } - $validator = \Validator::make([$model], \Budget::$rules); + $validator = \Validator::make($model, \Component::$rules); + if ($validator->invalid()) { - $errors->merge($errors); + $errors->merge($validator->errors()); } + + if(!$errors->has('name')) { $successes->add('name','OK'); } diff --git a/app/views/budgets/indexByBudget.blade.php b/app/views/budgets/indexByBudget.blade.php deleted file mode 100644 index b567fc482a..0000000000 --- a/app/views/budgets/indexByBudget.blade.php +++ /dev/null @@ -1,113 +0,0 @@ -@extends('layouts.default') -@section('content') -
Use budgets to organize and limit your expenses.
- -- Budgets are groups of expenses that reappear every [period]*. Examples could be "groceries", "bills" or - "drinks with friends". The table below lists all of the budgets you have, if any. - By definition, budgets are an estimated amount - of money, ie. € 400,-. Such an estimation can change over time but should always be set. Budgets - without an actual budget are fairly pointless. -
-- Use this page to create or change budgets and the estimated amount of money you think is wise. Pages further ahead - will explain what an "envelope" is in the context of budgeting. -
-- * Every month, week, year, etc. -
- - - -| Budget | -Current envelope(s) | -Update budget | -
|---|---|---|
| - {{{$budget->name}}} - - | -
-
-
- @foreach($budget->limits as $limit)
- @foreach($limit->limitrepetitions as $index => $rep)
-
- Envelope
-
-
- Left
-
-
-
- @endforeach
- @endforeach
-
-
-
-
- {{mf($rep->amount,false)}}
-
-
- @if($rep->leftInRepetition() < 0)
-
-
- {{mf($rep->leftInRepetition(),false)}}
- @else
-
-
- {{mf($rep->leftInRepetition(),false)}}
- @endif
-
-
-
-
- {{$rep->periodShow()}}
-
-
-
- @if($limit->repeats == 1)
-
- auto repeats
-
- @endif
-
- |
- - - | -
Use budgets to organize and limit your expenses.
- -- Budgets are groups of expenses that reappear every [period]*. Examples could be "groceries", "bills" or - "drinks with friends". The table below lists all of the budgets you have, if any. - By definition, budgets are an estimated amount - of money, ie. € 400,-. Such an estimation can change over time but should always be set. Budgets - without an actual budget are fairly pointless. -
-- Use this page to create or change budgets and the estimated amount of money you think is wise. Pages further ahead - will explain what an "envelope" is in the context of budgeting. -
-- * Every month, week, year, etc. -
- -| Budget | -Envelope | -Left | -- | |
|---|---|---|---|---|
| - - | -- - {{{$repetition->limit->budget->name}}} - - | -- - {{mf($repetition->amount,false)}} - | -- @if($repetition->left < 0) - - - {{mf($repetition->left,false)}} - @else - - - {{mf($repetition->left,false)}} - @endif - | -- - @if($repetition->limit->repeats == 1) - auto repeats - @endif - | -
- This view is filtered to only show transactions between {{Session::get('start')->format('d M Y')}} - and {{Session::get('end')->format('d M Y')}}. -
- @endif -No transactions
-Budgets can help you cut back on spending.
- @if($view == 1) - -- This view is filtered to show only the envelope from - {{{$repetitions[0]['limitrepetition']->periodShow()}}}, - which contains {{mf($repetitions[0]['limit']->amount,false)}}. -
- - @endif - - - @if($view == 2) - -- This view is filtered to show transactions not in an envelope only. -
- @endif - - @if($view == 3) - -- This view is filtered to only show transactions between {{Session::get('start')->format('d M Y')}} - and {{Session::get('end')->format('d M Y')}}. -
- @endif - @if($view != 4) -- Reset the filter -
- @endif - -No transactions
-