From c27d5ad8e9f5cadace3b071d76cfe8918efdd07f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 25 Apr 2024 18:28:43 +1000 Subject: [PATCH] Fixes for deleted clients in reports --- app/Export/CSV/InvoiceExport.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Export/CSV/InvoiceExport.php b/app/Export/CSV/InvoiceExport.php index 0ea3e916aeb5..a0f73ddc4e6a 100644 --- a/app/Export/CSV/InvoiceExport.php +++ b/app/Export/CSV/InvoiceExport.php @@ -57,6 +57,9 @@ class InvoiceExport extends BaseExport $query = Invoice::query() ->withTrashed() ->with('client') + ->whereHas('client', function ($q){ + $q->where('is_deleted', false); + }) ->where('company_id', $this->company->id) ->where('is_deleted', $this->input['include_deleted'] ?? false);