From 202ab0357c3aac0a90905e34bc9e32c4c7302436 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 14 May 2022 06:34:53 +1000 Subject: [PATCH] Attach task documents to invoice emails --- app/Mail/Engine/InvoiceEmailEngine.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Mail/Engine/InvoiceEmailEngine.php b/app/Mail/Engine/InvoiceEmailEngine.php index a3dae5f5aa..99bf304151 100644 --- a/app/Mail/Engine/InvoiceEmailEngine.php +++ b/app/Mail/Engine/InvoiceEmailEngine.php @@ -182,10 +182,9 @@ class InvoiceEmailEngine extends BaseEmailEngine $task_ids[] = $item->task_id; } - if(count($task_ids) > 0){ + if(count($task_ids) > 0 && $this->invoice->company->invoice_task_documents){ $tasks = Task::whereIn('id', $this->transformKeys($task_ids)) - ->where('invoice_documents', 1) ->cursor() ->each(function ($task){