From d2f2284d4daa070c5619f2aa88a1f0298150f9ed Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 7 Oct 2021 18:56:38 +1100 Subject: [PATCH] Fixes for recurring due dates --- app/Models/RecurringInvoice.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 822da29ff3..944a1038a1 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -449,6 +449,10 @@ class RecurringInvoice extends BaseModel public function calculateDueDate($date) { + //if nothing is set, assume we are using terms. + if(!$this->due_date_days) + return $this->calculateDateFromTerms($date); + switch ($this->due_date_days) { case 'terms': return $this->calculateDateFromTerms($date);