From 187c59c853e9487d547a38140a3d55bde81580f7 Mon Sep 17 00:00:00 2001 From: Paul Maillardet Date: Mon, 10 Jun 2024 14:47:02 +0200 Subject: [PATCH] Release hotfix 0.23.4 --- CHANGELOG.md | 4 ++++ VERSION | 2 +- server/src/App/Controllers/MaterialController.php | 4 ++-- server/src/App/Models/Material.php | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6200d76fe..926e5d5f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Tous les changements notables sur le projet sont documentés dans ce fichier. Ce projet adhère au principe du [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.23.4 (2024-06-10) + +- Corrige le tri du matériel selon la quantité. + ## 0.23.3 (2024-04-11) - Limite le nombre de vérifications différées simultanées du matériel manquant (2 par défaut). diff --git a/VERSION b/VERSION index 9e40e75c5..40a6dfede 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.23.3 +0.23.4 diff --git a/server/src/App/Controllers/MaterialController.php b/server/src/App/Controllers/MaterialController.php index 4ed76f4ea..5d6fffc96 100644 --- a/server/src/App/Controllers/MaterialController.php +++ b/server/src/App/Controllers/MaterialController.php @@ -135,14 +135,14 @@ public function getAll(Request $request, Response $response): ResponseInterface if ($orderBy === 'stock_quantity') { $query ->reorder( - $query->raw('IF(stock_quantity)'), + 'stock_quantity', $ascending ? 'asc' : 'desc', ); } if ($orderBy === 'out_of_order_quantity') { $query ->reorder( - $query->raw('IF(out_of_order_quantity)'), + 'out_of_order_quantity', $ascending ? 'asc' : 'desc', ); } diff --git a/server/src/App/Models/Material.php b/server/src/App/Models/Material.php index d8a300503..1587ec80f 100644 --- a/server/src/App/Models/Material.php +++ b/server/src/App/Models/Material.php @@ -605,7 +605,7 @@ public function scopeCustomOrderBy(Builder $query, string $column, string $direc if ($column === 'stock_quantity') { return $query ->orderBy( - $query->raw('IF(stock_quantity)'), + 'stock_quantity', $direction, ); } @@ -613,7 +613,7 @@ public function scopeCustomOrderBy(Builder $query, string $column, string $direc if ($column === 'out_of_order_quantity') { return $query ->orderBy( - $query->raw('IF(out_of_order_quantity)'), + 'out_of_order_quantity', $direction, ); }