From 6a3b8692e17fdfe692f513eef4f9fcfb48850449 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 2 Apr 2020 12:10:28 +1100 Subject: [PATCH] Fix Service::next_invoice_items() for invoices that should not be generated, but have additional charges --- app/Models/Service.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Service.php b/app/Models/Service.php index 1c51a84..09bc25d 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -854,7 +854,7 @@ class Service extends Model } // Add additional charges - if (($future = TRUE OR ($future == FALSE AND ($this->invoice_to < Carbon::now()->addDays(30)))) + if (($future == TRUE OR ($future == FALSE AND ($this->invoice_to < Carbon::now()->addDays(30)))) AND ! $this->invoice_items->filter(function($item) { return $item->module_id == 30 AND ! $item->exists; })->count()) { foreach ($this->charges->filter(function($item) { return ! $item->processed; }) as $oo) {