Fix Service::next_invoice_items() for invoices that should not be generated, but have additional charges

This commit is contained in:
Deon George 2020-04-02 12:10:28 +11:00
parent 10c8e43f7c
commit 6a3b8692e1
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254

View File

@ -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) {