All code for reminders based on piggy banks. I hope.

This commit is contained in:
James Cole
2014-08-23 22:32:12 +02:00
parent d56c00915c
commit 6e17c805c2
28 changed files with 652 additions and 44 deletions

View File

@@ -43,7 +43,6 @@ class TransactionController extends BaseController
$piggyRepository = App::make('Firefly\Storage\Piggybank\PiggybankRepositoryInterface');
$piggies = $piggyRepository->get();
return View::make('transactions.create')->with('accounts', $accounts)->with('budgets', $budgets)->with(
'what', $what
)->with('piggies', $piggies);
@@ -188,6 +187,16 @@ class TransactionController extends BaseController
$journal = $this->_repository->store($what, Input::all());
if ($journal->validate()) {
Session::flash('success', 'Transaction "' . $journal->description . '" saved!');
// if reminder present, deactivate it:
if(Input::get('reminder')) {
/** @var \Firefly\Storage\Reminder\ReminderRepositoryInterface $reminders */
$reminders = App::make('Firefly\Storage\Reminder\ReminderRepositoryInterface');
$reminder = $reminders->find(Input::get('reminder'));
$reminders->deactivate($reminder);
}
if (Input::get('create') == '1') {
return Redirect::route('transactions.create', [$what])->withInput();
} else {