From d32184a3d77bc337eff0e6ab7146bdd9fb8abac1 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 17 May 2022 14:50:10 +1000 Subject: [PATCH] Add auto bill tries into cron --- app/Jobs/Cron/AutoBillCron.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Jobs/Cron/AutoBillCron.php b/app/Jobs/Cron/AutoBillCron.php index cd5898231101..025e6ee68271 100644 --- a/app/Jobs/Cron/AutoBillCron.php +++ b/app/Jobs/Cron/AutoBillCron.php @@ -53,6 +53,7 @@ class AutoBillCron $auto_bill_partial_invoices = Invoice::whereDate('partial_due_date', '<=', now()) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) + ->where('auto_bill_tries', '<', 3) ->where('balance', '>', 0) ->where('is_deleted', false) ->whereHas('company', function ($query) { @@ -70,6 +71,7 @@ class AutoBillCron $auto_bill_invoices = Invoice::whereDate('due_date', '<=', now()) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) + ->where('auto_bill_tries', '<', 3) ->where('balance', '>', 0) ->where('is_deleted', false) ->whereHas('company', function ($query) { @@ -94,6 +96,7 @@ class AutoBillCron $auto_bill_partial_invoices = Invoice::whereDate('partial_due_date', '<=', now()) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) + ->where('auto_bill_tries', '<', 3) ->where('balance', '>', 0) ->where('is_deleted', false) ->whereHas('company', function ($query) { @@ -111,6 +114,7 @@ class AutoBillCron $auto_bill_invoices = Invoice::whereDate('due_date', '<=', now()) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) + ->where('auto_bill_tries', '<', 3) ->where('balance', '>', 0) ->where('is_deleted', false) ->whereHas('company', function ($query) {