diff --git a/app/controllers/RecurringController.php b/app/controllers/RecurringController.php index a70e92561e..612bdf7b89 100644 --- a/app/controllers/RecurringController.php +++ b/app/controllers/RecurringController.php @@ -37,8 +37,13 @@ class RecurringController extends BaseController } - public function edit() + public function edit(RecurringTransaction $recurringTransaction) { + $periods = \Config::get('firefly.periods_to_text'); + + return View::make('recurring.edit')->with('periods', $periods)->with( + 'recurringTransaction', $recurringTransaction + ); } public function index() @@ -71,7 +76,7 @@ class RecurringController extends BaseController } } - public function update() + public function update(RecurringTransaction $recurringTransaction) { } } \ No newline at end of file diff --git a/app/controllers/TransactionController.php b/app/controllers/TransactionController.php index 0dad583244..97d3d5ea37 100644 --- a/app/controllers/TransactionController.php +++ b/app/controllers/TransactionController.php @@ -133,14 +133,9 @@ class TransactionController extends BaseController * * @return $this|\Illuminate\View\View */ - public function show($journalId) + public function show(TransactionJournal $journal) { -// $journal = $this->_journal->find($journalId); -// if ($journal) { -// return View::make('transactions.show')->with('journal', $journal); -// } -// -// return View::make('error')->with('message', 'Invalid journal'); + return View::make('transactions.show')->with('journal', $journal); } /** diff --git a/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php b/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php index aad984cf59..f322aec042 100644 --- a/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php +++ b/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php @@ -386,7 +386,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito case 'Withdrawal': // means transaction[0] is the users account. $account = $accountRepository->find($data['account_id']); - $beneficiary = $accountRepository->findByName($data['beneficiary']); + $beneficiary = $accountRepository->createOrFindBeneficiary($data['beneficiary']); $transactions[0]->account()->associate($account); $transactions[1]->account()->associate($beneficiary); @@ -400,7 +400,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito case 'Deposit': // means transaction[0] is the beneficiary. $account = $accountRepository->find($data['account_id']); - $beneficiary = $accountRepository->findByName($data['beneficiary']); + $beneficiary = $accountRepository->createOrFindBeneficiary($data['beneficiary']); $journal->transactions[0]->account()->associate($beneficiary); $journal->transactions[1]->account()->associate($account); break; diff --git a/app/routes.php b/app/routes.php index ee14a44cb2..389a4c5130 100644 --- a/app/routes.php +++ b/app/routes.php @@ -147,6 +147,7 @@ Route::group(['before' => 'auth'], function () { // recurring transactions controller Route::get('/recurring',['uses' => 'RecurringController@index', 'as' => 'recurring.index']); + Route::get('/recurring/show/{recurring}',['uses' => 'RecurringController@show', 'as' => 'recurring.show']); Route::get('/recurring/create',['uses' => 'RecurringController@create', 'as' => 'recurring.create']); Route::get('/recurring/edit/{recurring}',['uses' => 'RecurringController@edit','as' => 'recurring.edit']); Route::get('/recurring/delete/{recurring}',['uses' => 'RecurringController@delete','as' => 'recurring.delete']); diff --git a/app/views/recurring/edit.blade.php b/app/views/recurring/edit.blade.php new file mode 100644 index 0000000000..1a4904ca45 --- /dev/null +++ b/app/views/recurring/edit.blade.php @@ -0,0 +1,194 @@ +@extends('layouts.default') +@section('content') +
Use recurring transactions to track repeated expenses
++ Bla bla. +
+{{$errors->first('name')}}
+ @else + For example: rent, gas, insurance + @endif +{{$errors->first('match')}}
+ @else + For example: rent, [company name]. All matches need to + be present for the recurring transaction to be recognized. This field is not case-sensitive. + @endif +{{$errors->first('amount_min')}}
+ @else + Firefly will only include transactions with a higher amount than this. If your rent + is usually around € 500,-, enter450
to be safe.
+ @endif
+ {{$errors->first('amount_max')}}
+ @else + Firefly will only include transactions with a lower amount than this. + If your rent is usually around € 500,-, enter550
to be safe.
+ @endif
+ {{$errors->first('date')}}
+ @else + Select the next date you expect the transaction to occur. + @endif +{{$errors->first('repeat_freq')}}
+ @else + Select the period over which this transaction repeats + @endif +{{$errors->first('skip')}}
+ @else + Make Firefly skip every n times. Fill in2
, and Firefly
+ will match, skip, skip and match a transaction.
+ @endif
+ {{$errors->first('description')}}
+ @endif{{$errors->first('account_id')}}
+ @endif{{$errors->first('beneficiary')}}
+ @else This field will auto-complete your existing beneficiaries (if any), but you can type freely to create new ones. + @endif{{$errors->first('date')}}
+ @endif{{$errors->first('budget_id')}}
+ @else Select one of your budgets to make this transaction a part of it. + @endif{{$errors->first('category')}}
+ @else Add more fine-grained information to this transaction by entering a category. Like the beneficiary-field, this field will auto-complete existing categories but can also be used to create new ones. + @endif