diff --git a/app/Models/Traits/HasRecurrence.php b/app/Models/Traits/HasRecurrence.php index 2888e54bc014..a81ef8cc0280 100644 --- a/app/Models/Traits/HasRecurrence.php +++ b/app/Models/Traits/HasRecurrence.php @@ -129,12 +129,10 @@ trait HasRecurrence $startDate = $this->getOriginal('last_sent_date') ?: $this->getOriginal('start_date'); $startDate .= ' ' . $this->account->recurring_hour . ':00:00'; - $startDate = $this->account->getDateTime($startDate); - $endDate = $this->end_date ? $this->account->getDateTime($this->getOriginal('end_date')) : null; $timezone = $this->account->getTimezone(); $rule = $this->getRecurrenceRule(); - $rule = new \Recurr\Rule("{$rule}", $startDate); + $rule = new \Recurr\Rule("{$rule}", $startDate, null, $timezone); // Fix for months with less than 31 days $transformerConfig = new \Recurr\Transformer\ArrayTransformerConfig(); @@ -144,7 +142,7 @@ trait HasRecurrence $transformer->setConfig($transformerConfig); $dates = $transformer->transform($rule); - if (count($dates) < 2) { + if (count($dates) < 1) { return false; } diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index fc665767c78d..b7350ef4529f 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -294,8 +294,10 @@ {!! trans('texts.last_sent_on', ['date' => link_to('/invoices/'.$lastSent->public_id, $invoice->last_sent_date, ['id' => 'lastSent'])]) !!}
@endif @if ($invoice->is_recurring && $invoice->start_date && $invoice->is_public) - {!! trans('texts.next_send_on', ['date' => ''.$account->formatDate($invoice->getNextSendDate() ?: $invoice->start_date). - '']) !!} + @if ($sendNextDate = $invoice->getNextSendDate()) + {!! trans('texts.next_send_on', ['date' => '' . $account->formatDate($sendNextDate). + '']) !!} + @endif @if ($invoice->getDueDate())