Added schedule:list, fixed traffic import service, fixed invoice generation with charges and credit amounts

This commit is contained in:
Deon George
2020-05-29 14:10:10 +10:00
parent 7f1681f0b7
commit 121aa5b31c
6 changed files with 67 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ class InvoiceGenerate extends Command
foreach ($accounts as $o) {
$io = new Invoice;
$io->account_id = $o->id;
foreach ($o->services(TRUE)->get() as $so) {
foreach ($so->next_invoice_items(FALSE) as $ooo)
@@ -54,7 +55,7 @@ class InvoiceGenerate extends Command
}
// If there are no items, no reason to do anything
if (! $io->items->count())
if (! $io->items->count() OR $io->total < 0)
continue;
$io->account_id = $o->id;