1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Additional logging for auto bill

This commit is contained in:
David Bomba 2021-10-05 08:17:41 +11:00
parent d562630957
commit 491d5e9f89
3 changed files with 8 additions and 5 deletions

View File

@ -50,6 +50,8 @@ class AutoBill
MultiDB::setDb($this->db);
try{
nlog("autobill {$this->invoice->id}");
$this->invoice->service()->autoBill()->save();

View File

@ -25,6 +25,8 @@ class AutoBillCron
public $tries = 1;
private $counter = 1;
/**
* Create a new job instance.
*
@ -120,14 +122,17 @@ class AutoBillCron
nlog($auto_bill_invoices->count(). " full invoices to auto bill db = {$db}");
$auto_bill_invoices->cursor()->each(function ($invoice) use($db){
nlog($this->counter);
AutoBill::dispatch($invoice, $db);
$this->counter++;
});
}
nlog("fine");
nlog("Auto Bill - fine");
}
}

View File

@ -309,10 +309,6 @@ class BaseRepository
/* Perform model specific tasks */
if ($model instanceof Invoice) {
nlog("Finished amount = " . $state['finished_amount']);
nlog("Starting amount = " . $state['starting_amount']);
nlog("Diff = " . ($state['finished_amount'] - $state['starting_amount']));
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) {