diff --git a/services/nginx/app/routes/vehiclesRoute.php b/services/nginx/app/routes/vehiclesRoute.php index 43140327..fc847a35 100644 --- a/services/nginx/app/routes/vehiclesRoute.php +++ b/services/nginx/app/routes/vehiclesRoute.php @@ -829,12 +829,14 @@ class vehiclesRoute $booking = (new order_bookings_o())->getFieldsWhere([ 'reg_1' => $reg, 'order_id' => null, + 'deleted_at' => null, ], ['id', 'customer_number', 'reference', 'note']); // If there is no booking with the tractor reg, check the trailer reg if (!$booking) { $booking = (new order_bookings_o())->getFieldsWhere([ 'reg_2' => $reg, 'order_id' => null, + 'deleted_at' => null, ], ['id', 'customer_number', 'reference', 'note']); } // Populate other variables @@ -973,6 +975,7 @@ class vehiclesRoute [ 'reg_1' => $search, 'order_id' => null, + 'deleted_at' => null, ...$filters ], ['reg_1'], @@ -982,6 +985,7 @@ class vehiclesRoute [ 'reg_2' => $search, 'order_id' => null, + 'deleted_at' => null, ...$filters ], ['reg_2'], diff --git a/services/nginx/app/traits/db_object_t.php b/services/nginx/app/traits/db_object_t.php index 893ad950..0d077371 100644 --- a/services/nginx/app/traits/db_object_t.php +++ b/services/nginx/app/traits/db_object_t.php @@ -192,7 +192,7 @@ trait db_object_t $where = []; foreach ( $fieldsAndValues as $field => $value ) { // Check if the value is null - if ($value === null) { + if ($value === null || $value === 'null') { $where[] = "$field IS NULL"; continue; }