From cb2a0fcdaaaf148acffb76d03b7b333dd4e4ff6f Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 8 Sep 2026 15:10:49 +0200 Subject: [PATCH] =?UTF-8?q?Trie=20le=20graph=20versements=20par=20ordre=20?= =?UTF-8?q?alphab=C3=A9tique,=20Salaire/stage=20et=20Sous-traitant=20en=20?= =?UTF-8?q?dernier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les 6 comptes sont désormais triés alphabétiquement plutôt que par montant décroissant ; Salaire/stage et Sous-traitant ne participent pas à ce tri, ils sont simplement ajoutés après coup, dans cet ordre fixe. --- .../custom/figli_compta_ledger/js/dashboard.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web/modules/custom/figli_compta_ledger/js/dashboard.js b/web/modules/custom/figli_compta_ledger/js/dashboard.js index efdf5d1..78c2bfe 100644 --- a/web/modules/custom/figli_compta_ledger/js/dashboard.js +++ b/web/modules/custom/figli_compta_ledger/js/dashboard.js @@ -195,13 +195,18 @@ // the two extra rows keep their own type colour. versementsParCompteItems() { if (!this.stats) return []; + // Alphabetical among the 6 comptes, but Salaire/stage and + // Sous-traitant always pushed on afterward -- they're not + // comptes, so they stay out of that ordering and just close out + // the list, in that fixed order. const items = Object.entries(this.stats.total_par_type_par_compte) .filter(([, parType]) => parType.versement !== undefined) - .map(([compte, parType]) => ({ label: compte, value: parType.versement, type: 'versement' })); + .map(([compte, parType]) => ({ label: compte, value: parType.versement, type: 'versement' })) + .sort((a, b) => a.label.localeCompare(b.label, 'fr')); const parType = this.stats.total_par_type || {}; if (parType.salaire_stage) items.push({ label: TYPE_LABELS.salaire_stage, value: parType.salaire_stage, type: 'salaire_stage' }); if (parType.sous_traitant) items.push({ label: TYPE_LABELS.sous_traitant, value: parType.sous_traitant, type: 'sous_traitant' }); - return items.sort((a, b) => b.value - a.value); + return items; }, // Small multiples, one per year -- same source as typeItemsParAnnee // above (total_par_type_par_compte_par_annee, already there for @@ -212,11 +217,12 @@ const parCompte = this.stats.total_par_type_par_compte_par_annee[annee] || {}; const items = Object.entries(parCompte) .filter(([, parType]) => parType.versement !== undefined) - .map(([compte, parType]) => ({ label: compte, value: parType.versement, type: 'versement' })); + .map(([compte, parType]) => ({ label: compte, value: parType.versement, type: 'versement' })) + .sort((a, b) => a.label.localeCompare(b.label, 'fr')); const parType = this.stats.total_par_type_par_annee[annee] || {}; if (parType.salaire_stage) items.push({ label: TYPE_LABELS.salaire_stage, value: parType.salaire_stage, type: 'salaire_stage' }); if (parType.sous_traitant) items.push({ label: TYPE_LABELS.sous_traitant, value: parType.sous_traitant, type: 'sous_traitant' }); - return { annee, items: items.sort((a, b) => b.value - a.value) }; + return { annee, items }; }).filter((y) => y.items.length); }, totalCA() {