From 02e535b5a17808c1b604c60d0a25b08c26c9d107 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 31 Dec 2020 09:18:29 +1100 Subject: [PATCH 1/2] Fix for recurring invoice null next_send_date --- app/Models/RecurringInvoice.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 94358ec74b90..7d28949e2f2a 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -366,10 +366,14 @@ class RecurringInvoice extends BaseModel if ($this->remaining_cycles == -1) { $iterations = 10; } + + $data = []; + if(!$this->next_send_date) + return $data; + $next_send_date = Carbon::parse($this->next_send_date)->copy(); - $data = []; for ($x=0; $x<$iterations; $x++) { // we don't add the days... we calc the day of the month!! From 1a87b05b96157c43654d722c04353fe7677fd8a1 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 1 Jan 2021 11:52:42 +1100 Subject: [PATCH 2/2] Display client name if contact is not present --- app/Models/Presenters/ClientContactPresenter.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Models/Presenters/ClientContactPresenter.php b/app/Models/Presenters/ClientContactPresenter.php index fc87b8b7854f..3c2dc014246d 100644 --- a/app/Models/Presenters/ClientContactPresenter.php +++ b/app/Models/Presenters/ClientContactPresenter.php @@ -20,8 +20,13 @@ class ClientContactPresenter extends EntityPresenter * @return string */ public function name() - { - return $this->entity->first_name.' '.$this->entity->last_name; + { + $contact_name = $this->entity->first_name.' '.$this->entity->last_name; + + if(strlen($contact_name) > 1) + return $contact_name; + + return $this->entity->client->present()->name(); } public function first_name()