From 2ff8a351712a863ab34d66a9584e7ac62527863c Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 4 May 2020 10:06:13 +0200 Subject: [PATCH 01/26] Add debug. --- app/Support/Cronjobs/RecurringCronjob.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Support/Cronjobs/RecurringCronjob.php b/app/Support/Cronjobs/RecurringCronjob.php index dfd7fd413b..6e5cd4b7a3 100644 --- a/app/Support/Cronjobs/RecurringCronjob.php +++ b/app/Support/Cronjobs/RecurringCronjob.php @@ -86,6 +86,7 @@ class RecurringCronjob extends AbstractCronjob $job->setForce($this->force); $job->handle(); app('fireflyconfig')->set('last_rt_job', (int)$this->date->format('U')); + Log::info(sprintf('Marked the last time this job has run as "%s" (%d)',$this->date->format('Y-m-d H:i:s'),(int)$this->date->format('U'))); Log::info('Done with recurring cron job task.'); } } From 6f6087995de214750af8808fbda2ee73a5e7b810 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 4 May 2020 10:12:38 +0200 Subject: [PATCH 02/26] Add info on expired recurring transactions. --- app/Http/Controllers/Recurring/IndexController.php | 7 ++++--- resources/lang/en_US/firefly.php | 1 + resources/views/v1/recurring/index.twig | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Recurring/IndexController.php b/app/Http/Controllers/Recurring/IndexController.php index 449cca69cc..ea84c7044e 100644 --- a/app/Http/Controllers/Recurring/IndexController.php +++ b/app/Http/Controllers/Recurring/IndexController.php @@ -85,6 +85,8 @@ class IndexController extends Controller $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page'); $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $collection = $this->recurring->get(); + $today = new Carbon; + $year = new Carbon; // split collection $total = $collection->count(); @@ -98,8 +100,7 @@ class IndexController extends Controller $recurring = []; /** @var Recurrence $recurrence */ foreach ($recurrences as $recurrence) { - $today = new Carbon; - $year = new Carbon; + $year->addYear(); if ($recurrence->first_date > $today) { $today = clone $recurrence->first_date; @@ -123,7 +124,7 @@ class IndexController extends Controller $this->verifyRecurringCronJob(); - return view('recurring.index', compact('paginator', 'page', 'pageSize', 'total')); + return view('recurring.index', compact('paginator', 'today', 'page', 'pageSize', 'total')); } } diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 2707ff6e11..03164d86dd 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -1519,6 +1519,7 @@ return [ // recurring transactions 'recurrences' => 'Recurring transactions', + 'repeat_until_in_past' => 'This recurring transaction stopped repeating on :date.', 'recurring_calendar_view' => 'Calendar', 'no_recurring_title_default' => 'Let\'s create a recurring transaction!', 'no_recurring_intro_default' => 'You have no recurring transactions yet. You can use these to make Firefly III automatically create transactions for you.', diff --git a/resources/views/v1/recurring/index.twig b/resources/views/v1/recurring/index.twig index 98f53febe2..dd6bd8386a 100644 --- a/resources/views/v1/recurring/index.twig +++ b/resources/views/v1/recurring/index.twig @@ -85,6 +85,11 @@ + {% if null != rt.repeat_until and today > rt.repeat_until %} + + {{ trans('firefly.repeat_until_in_past', {date: rt.repeat_until.formatLocalized(monthAndDayFormat) }) }} + + {% endif %}