From 1a135c32a49050e68f932c06008dcdb37cc3f950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Escarr=C3=A1?= Date: Fri, 27 Oct 2023 09:39:22 -0500 Subject: [PATCH] Add "uninvoiced" Task Filter Allow to filter Tasks for those that are not yet invoiced --- app/Filters/TaskFilters.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Filters/TaskFilters.php b/app/Filters/TaskFilters.php index eb3ca35c414b..53cc0f01583c 100644 --- a/app/Filters/TaskFilters.php +++ b/app/Filters/TaskFilters.php @@ -60,6 +60,7 @@ class TaskFilters extends QueryFilters * Statuses we need to handle * - all * - invoiced + * - uninvoiced * * @param string $value The invoice status as seen by the client * @return Builder @@ -80,6 +81,10 @@ class TaskFilters extends QueryFilters $this->builder->whereNotNull('invoice_id'); } + if (in_array('uninvoiced', $status_parameters)) { + $this->builder->whereNull('invoice_id'); + } + return $this->builder; }