From 7f1201e3dac27ffc14b75abced7c65226cebda6e Mon Sep 17 00:00:00 2001 From: Adrien RENARD Date: Tue, 13 Feb 2024 14:01:51 +0100 Subject: [PATCH] Tris des types de paniers par valeur dans les listes d'une livraison --- conf/db_struct.php | 1 + functions/functions_livraisons.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/db_struct.php b/conf/db_struct.php index 569675d..f1bc0c9 100644 --- a/conf/db_struct.php +++ b/conf/db_struct.php @@ -471,6 +471,7 @@ function getLivraisonsPaniersSelectBaseSQL() { .CONTRATS_PANIERS_STATUT.".`nb_paniers_restants`," .CONTRATS_TABLE.".`panier_type` as 'panier_type_ref'," .PANIERS_TYPES_TABLE.".`nom` as 'panier_type_nom'," + .PANIERS_TYPES_TABLE.".`valeur` as 'panier_type_valeur'," .CONTRATS_TABLE.".`lieu_depot` as 'lieu_depot_ref'," .LIEUX_TABLE.".`nom` as 'lieu_depot_nom'," .LIVRAISONS_PANIERS_TABLE.".`complement`," diff --git a/functions/functions_livraisons.php b/functions/functions_livraisons.php index cf0bd5e..d68d66b 100644 --- a/functions/functions_livraisons.php +++ b/functions/functions_livraisons.php @@ -389,6 +389,7 @@ function getLivraisonPaniersEligibles($paniers_groupe, $date, $quinz_groupe, $pa $list[$lieu]["paniers"][$pType] = array( "type_ref" => $pType, "type_nom" => $i['panier_type_nom'], + "type_valeur" => $i['panier_type_valeur'], "nb_paniers" => 0, "paniers" => array() ); @@ -410,7 +411,7 @@ function getLivraisonPaniersEligibles($paniers_groupe, $date, $quinz_groupe, $pa // ORDER $list = orderListByKey($list, "nom", "ASC"); - for($i =0; $i $i["panier_type_ref"], "type_nom" => $i["panier_type_nom"], + "type_valeur" => $i["panier_type_valeur"], "paniers" => array() ); } @@ -469,7 +471,7 @@ function getLivraisonPaniers($livraison, $lieu=0, $group_by_type=false) { $GLOBALS['errors'][] = "Une erreur est survenue durant la récupération de la liste des paniers de la livraison dans le base de données !".$er; } - if($group_by_type) $list = orderListByKey($list, "type_nom", "ASC"); + if($group_by_type) $list = orderListByKey($list, "type_valeur", "ASC"); return $list; }