mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6773 from turbo124/v5-develop
Additional logging for auto billing
This commit is contained in:
commit
10dadf8ca3
@ -50,6 +50,8 @@ class AutoBill
|
|||||||
MultiDB::setDb($this->db);
|
MultiDB::setDb($this->db);
|
||||||
|
|
||||||
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.
|
||||||
*
|
*
|
||||||
@ -56,6 +58,7 @@ class AutoBillCron
|
|||||||
->whereHas('company', function ($query) {
|
->whereHas('company', function ($query) {
|
||||||
$query->where('is_disabled',0);
|
$query->where('is_disabled',0);
|
||||||
})
|
})
|
||||||
|
->orderBy('id', 'DESC')
|
||||||
->with('company');
|
->with('company');
|
||||||
|
|
||||||
nlog($auto_bill_partial_invoices->count(). " partial invoices to auto bill");
|
nlog($auto_bill_partial_invoices->count(). " partial invoices to auto bill");
|
||||||
@ -72,6 +75,7 @@ class AutoBillCron
|
|||||||
->whereHas('company', function ($query) {
|
->whereHas('company', function ($query) {
|
||||||
$query->where('is_disabled',0);
|
$query->where('is_disabled',0);
|
||||||
})
|
})
|
||||||
|
->orderBy('id', 'DESC')
|
||||||
->with('company');
|
->with('company');
|
||||||
|
|
||||||
nlog($auto_bill_invoices->count(). " full invoices to auto bill");
|
nlog($auto_bill_invoices->count(). " full invoices to auto bill");
|
||||||
@ -95,6 +99,7 @@ class AutoBillCron
|
|||||||
->whereHas('company', function ($query) {
|
->whereHas('company', function ($query) {
|
||||||
$query->where('is_disabled',0);
|
$query->where('is_disabled',0);
|
||||||
})
|
})
|
||||||
|
->orderBy('id', 'DESC')
|
||||||
->with('company');
|
->with('company');
|
||||||
|
|
||||||
nlog($auto_bill_partial_invoices->count(). " partial invoices to auto bill db = {$db}");
|
nlog($auto_bill_partial_invoices->count(). " partial invoices to auto bill db = {$db}");
|
||||||
@ -111,19 +116,23 @@ class AutoBillCron
|
|||||||
->whereHas('company', function ($query) {
|
->whereHas('company', function ($query) {
|
||||||
$query->where('is_disabled',0);
|
$query->where('is_disabled',0);
|
||||||
})
|
})
|
||||||
|
->orderBy('id', 'DESC')
|
||||||
->with('company');
|
->with('company');
|
||||||
|
|
||||||
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,10 +309,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)) {
|
||||||
|
|
||||||
|
406
composer.lock
generated
406
composer.lock
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user