mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Additional logging for auto bill
This commit is contained in:
parent
d562630957
commit
491d5e9f89
@ -51,6 +51,8 @@ class AutoBill
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
|
nlog("autobill {$this->invoice->id}");
|
||||||
|
|
||||||
$this->invoice->service()->autoBill()->save();
|
$this->invoice->service()->autoBill()->save();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ class AutoBillCron
|
|||||||
|
|
||||||
public $tries = 1;
|
public $tries = 1;
|
||||||
|
|
||||||
|
private $counter = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
@ -120,14 +122,17 @@ class AutoBillCron
|
|||||||
nlog($auto_bill_invoices->count(). " full invoices to auto bill db = {$db}");
|
nlog($auto_bill_invoices->count(). " full invoices to auto bill db = {$db}");
|
||||||
|
|
||||||
$auto_bill_invoices->cursor()->each(function ($invoice) use($db){
|
$auto_bill_invoices->cursor()->each(function ($invoice) use($db){
|
||||||
|
|
||||||
|
nlog($this->counter);
|
||||||
AutoBill::dispatch($invoice, $db);
|
AutoBill::dispatch($invoice, $db);
|
||||||
|
$this->counter++;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nlog("fine");
|
nlog("Auto Bill - fine");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,10 +310,6 @@ class BaseRepository
|
|||||||
/* Perform model specific tasks */
|
/* Perform model specific tasks */
|
||||||
if ($model instanceof Invoice) {
|
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)) {
|
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) {
|
||||||
|
|
||||||
$model->service()->updateStatus()->save();
|
$model->service()->updateStatus()->save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user