Added schedule:list, fixed traffic import service, fixed invoice generation with charges and credit amounts
This commit is contained in:
@@ -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;
|
||||
|
@@ -5,6 +5,7 @@ namespace App\Console;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
use App\Models\AdslSupplier;
|
||||
use App\Jobs\BroadbandTraffic;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
@@ -26,7 +27,9 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->job(new BroadbandTraffic())->dailyAt('10:00');
|
||||
// @todo This needs to be more generic and dynamic
|
||||
// Exetel Traffic
|
||||
$schedule->job(new BroadbandTraffic(AdslSupplier::find(1)))->timezone('Australia/Melbourne')->dailyAt('10:00');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user