From 8f9a318efbf5b5a8c163c580f125394ed414b3c8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Sep 2021 09:28:27 +1000 Subject: [PATCH] Fixes for auto billing --- 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 99bcdbbf21f8..b0aff37007be 100644 --- a/app/Jobs/Cron/AutoBillCron.php +++ b/app/Jobs/Cron/AutoBillCron.php @@ -51,6 +51,7 @@ class AutoBillCron ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) ->where('balance', '>', 0) + ->where('is_deleted', false) ->with('company') ->cursor()->each(function ($invoice){ $this->runAutoBiller($invoice); @@ -60,6 +61,7 @@ class AutoBillCron ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) ->where('balance', '>', 0) + ->where('is_deleted', false) ->with('company') ->cursor()->each(function ($invoice){ $this->runAutoBiller($invoice); @@ -76,6 +78,7 @@ class AutoBillCron ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) ->where('balance', '>', 0) + ->where('is_deleted', false) ->with('company') ->cursor()->each(function ($invoice){ $this->runAutoBiller($invoice); @@ -85,6 +88,7 @@ class AutoBillCron ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->where('auto_bill_enabled', true) ->where('balance', '>', 0) + ->where('is_deleted', false) ->with('company') ->cursor()->each(function ($invoice){ $this->runAutoBiller($invoice);