From ba8fcb0de0299e92101f8a6f9f03b3b02baa7272 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 2 Jan 2021 09:52:42 +1100 Subject: [PATCH] Fixes for next_send_date when updating a recurring invoice --- app/Models/RecurringInvoice.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index c6e3a03199bf..8e50b30a386d 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -369,11 +369,11 @@ class RecurringInvoice extends BaseModel $data = []; - $next_send_date = Carbon::parse($this->next_send_date)->copy(); - - if(!$next_send_date) + if(!Carbon::parse($this->next_send_date)) return $data; + $next_send_date = Carbon::parse($this->next_send_date)->copy(); + for ($x=0; $x<$iterations; $x++) { // we don't add the days... we calc the day of the month!! $next_due_date = $this->calculateDueDate($next_send_date->copy()->format('Y-m-d'));