diff --git a/app/Traits/Recurring.php b/app/Traits/Recurring.php index f6780168535..ef515ce9e39 100644 --- a/app/Traits/Recurring.php +++ b/app/Traits/Recurring.php @@ -186,26 +186,19 @@ public function getRecurringVirtualLimit() return $limit; } - public function getCurrentRecurring() + public function getNextRecurring() { if (! $schedule = $this->getRecurringSchedule()) { return false; } - if (! $current = $schedule->current()) { - return false; - } - - return $current->getStart(); - } + $schedule = $schedule->startsAfter($this->getRecurringRuleTodayDate()); - public function getNextRecurring() - { - if (! $schedule = $this->getRecurringSchedule()) { + if ($schedule->count() == 0) { return false; } - if (! $next = $schedule->next()) { + if (! $next = $schedule->current()) { return false; }