From e891238db0f0b5a6f720ccbfc07c0948bc2d2fb8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 29 Oct 2020 13:55:26 +1100 Subject: [PATCH] Set next_send_date to null when balance == 0 --- app/Services/Invoice/InvoiceService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 4ec63141df4c..da1393e21409 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -113,6 +113,9 @@ class InvoiceService { $this->invoice = (new UpdateBalance($this->invoice, $balance_adjustment))->run(); + if((int)$this->invoice->balance == 0) + $this->invoice->next_send_date = null; + return $this; }