Add auto bill tries into cron

This commit is contained in:
= 2022-05-17 14:50:10 +10:00
parent ede64ef03d
commit d32184a3d7

View File

@ -53,6 +53,7 @@ class AutoBillCron
$auto_bill_partial_invoices = Invoice::whereDate('partial_due_date', '<=', now()) $auto_bill_partial_invoices = Invoice::whereDate('partial_due_date', '<=', now())
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('auto_bill_enabled', true) ->where('auto_bill_enabled', true)
->where('auto_bill_tries', '<', 3)
->where('balance', '>', 0) ->where('balance', '>', 0)
->where('is_deleted', false) ->where('is_deleted', false)
->whereHas('company', function ($query) { ->whereHas('company', function ($query) {
@ -70,6 +71,7 @@ class AutoBillCron
$auto_bill_invoices = Invoice::whereDate('due_date', '<=', now()) $auto_bill_invoices = Invoice::whereDate('due_date', '<=', now())
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('auto_bill_enabled', true) ->where('auto_bill_enabled', true)
->where('auto_bill_tries', '<', 3)
->where('balance', '>', 0) ->where('balance', '>', 0)
->where('is_deleted', false) ->where('is_deleted', false)
->whereHas('company', function ($query) { ->whereHas('company', function ($query) {
@ -94,6 +96,7 @@ class AutoBillCron
$auto_bill_partial_invoices = Invoice::whereDate('partial_due_date', '<=', now()) $auto_bill_partial_invoices = Invoice::whereDate('partial_due_date', '<=', now())
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('auto_bill_enabled', true) ->where('auto_bill_enabled', true)
->where('auto_bill_tries', '<', 3)
->where('balance', '>', 0) ->where('balance', '>', 0)
->where('is_deleted', false) ->where('is_deleted', false)
->whereHas('company', function ($query) { ->whereHas('company', function ($query) {
@ -111,6 +114,7 @@ class AutoBillCron
$auto_bill_invoices = Invoice::whereDate('due_date', '<=', now()) $auto_bill_invoices = Invoice::whereDate('due_date', '<=', now())
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('auto_bill_enabled', true) ->where('auto_bill_enabled', true)
->where('auto_bill_tries', '<', 3)
->where('balance', '>', 0) ->where('balance', '>', 0)
->where('is_deleted', false) ->where('is_deleted', false)
->whereHas('company', function ($query) { ->whereHas('company', function ($query) {