From 89f8f9b45be0cd1ceb1d7104d397dab9b8e434fe Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 24 Jun 2018 16:17:42 +0200 Subject: [PATCH] Fix view of bills. --- app/Console/Kernel.php | 10 ---------- app/Http/Requests/BillFormRequest.php | 2 ++ app/Services/Internal/Update/BillUpdateService.php | 2 +- resources/views/bills/show.twig | 4 ++-- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 23c1135e92..f9fba1df4b 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -74,15 +74,5 @@ class Kernel extends ConsoleKernel event(new AdminRequestedTestMessage($user, $ipAddress)); } )->daily(); - - // send test email. - $schedule->call( - function () { - $ipAddress = '127.0.0.2'; - /** @var User $user */ - $user = User::find(1); - event(new AdminRequestedTestMessage($user, $ipAddress)); - } - )->hourly(); } } diff --git a/app/Http/Requests/BillFormRequest.php b/app/Http/Requests/BillFormRequest.php index 82e1581156..df36e4946e 100644 --- a/app/Http/Requests/BillFormRequest.php +++ b/app/Http/Requests/BillFormRequest.php @@ -50,6 +50,7 @@ class BillFormRequest extends Request 'repeat_freq' => $this->string('repeat_freq'), 'skip' => $this->integer('skip'), 'notes' => $this->string('notes'), + 'active' => $this->boolean('active'), ]; } @@ -72,6 +73,7 @@ class BillFormRequest extends Request 'date' => 'required|date', 'repeat_freq' => 'required|in:weekly,monthly,quarterly,half-year,yearly', 'skip' => 'required|between:0,31', + 'active' => 'boolean', ]; return $rules; diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.php index 97e89b1753..72c811bee2 100644 --- a/app/Services/Internal/Update/BillUpdateService.php +++ b/app/Services/Internal/Update/BillUpdateService.php @@ -51,7 +51,7 @@ class BillUpdateService $bill->repeat_freq = $data['repeat_freq']; $bill->skip = $data['skip']; $bill->automatch = true; - $bill->active = $data['active']; + $bill->active = $data['active']??true; $bill->save(); // update note: diff --git a/resources/views/bills/show.twig b/resources/views/bills/show.twig index fe877f39e1..f22355adb5 100644 --- a/resources/views/bills/show.twig +++ b/resources/views/bills/show.twig @@ -91,13 +91,13 @@ {{ 'rescan_old'|_ }} - {% if object.data.notes != '' %} + {% if object.data.notes.data[0] %}

{{ 'notes'|_ }}

- {{ object.data.notes }} + {{ object.data.notes.data[0].markdown|raw }}
{% endif %}