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);