diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 7e6040fc2b..9aefd01b86 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -464,7 +464,7 @@ class TransactionController extends Controller Session::flash('info', $att->getMessages()->get('attachments')); } - event(new TransactionJournalStored($journal, intval($request->get('piggy_bank_id')))); + event(new TransactionJournalStored($journal, intval($journalData['piggy_bank_id']))); Session::flash('success', strval(trans('firefly.stored_journal', ['description' => e($journal->description)]))); Preferences::mark(); diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index 8b8886b76b..db26820994 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -51,6 +51,7 @@ class JournalFormRequest extends Request 'budget_id' => intval($this->get('budget_id')), 'category' => $this->get('category') ?? '', 'tags' => explode(',', $tags), + 'piggy_bank_id' => $this->get('piggy_bank_id') ? intval($this->get('piggy_bank_id')) : 0, ]; } @@ -71,7 +72,7 @@ class JournalFormRequest extends Request 'interest_date' => 'date', 'category' => 'between:1,255', 'amount_currency_id_amount' => 'required|exists:transaction_currencies,id', - + 'piggy_bank_id' => 'numeric', ]; switch ($what) {