From 4636fc352267a7e0c7c9dade6389473245243f67 Mon Sep 17 00:00:00 2001 From: bach Date: Fri, 4 Sep 2026 12:53:55 +0200 Subject: [PATCH] =?UTF-8?q?Color=20and=20bold=20Montant=20HT=20to=20distin?= =?UTF-8?q?guish=20entr=C3=A9es=20from=20sorties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Single anchor per row -- Montant TTC and the 8 compte columns stay neutral, so the table doesn't turn into a red/green garland. No 0.5€ threshold like soldeClass (used for aggregate totals): individual lines are often small (a -1.07€ OVH renewal shouldn't read as "neutral"), any nonzero sign gets colored. Co-Authored-By: Claude Sonnet 5 --- web/modules/custom/figli_compta_ledger/css/home.css | 12 ++++++++++++ web/modules/custom/figli_compta_ledger/js/home.js | 10 ++++++++++ .../templates/figli-compta-home.html.twig | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/web/modules/custom/figli_compta_ledger/css/home.css b/web/modules/custom/figli_compta_ledger/css/home.css index 5de3b30..f7b5684 100644 --- a/web/modules/custom/figli_compta_ledger/css/home.css +++ b/web/modules/custom/figli_compta_ledger/css/home.css @@ -153,6 +153,18 @@ html.gin--dark-mode #figli-home-app { color: var(--figli-error); } +/* Single colored + bold anchor per row (Montant HT only) so entrées vs + sorties are scannable at a glance -- everything else in the row (TTC, + the 8 compte columns) stays neutral, not a red/green garland. */ +#figli-home-app td.figli-montant-positif { + color: var(--figli-positive); + font-weight: 700; +} +#figli-home-app td.figli-montant-negatif { + color: var(--figli-error); + font-weight: 700; +} + /* Error rows: a thin red outline around the row, not a background fill -- easier to read, doesn't fight with dark mode. */ #figli-home-app tr.figli-error-row td { diff --git a/web/modules/custom/figli_compta_ledger/js/home.js b/web/modules/custom/figli_compta_ledger/js/home.js index 75f99e7..2ccb303 100644 --- a/web/modules/custom/figli_compta_ledger/js/home.js +++ b/web/modules/custom/figli_compta_ledger/js/home.js @@ -249,6 +249,16 @@ if (v < -0.5) return 'figli-solde-debiteur'; return ''; }, + // Single colored anchor per row (Montant HT only, not every compte + // column) so entrées/sorties are scannable at a glance without the + // table turning into a red/green garland. No 0.5€ threshold like + // soldeClass -- individual lines are often small (e.g. a -1.07€ OVH + // renewal), any nonzero sign should read as positive/negative. + montantClass(v) { + if (v > 0) return 'figli-montant-positif'; + if (v < 0) return 'figli-montant-negatif'; + return ''; + }, openAddForm() { Drupal.ajax({ url: '/node/add/ligne_comptable', diff --git a/web/modules/custom/figli_compta_ledger/templates/figli-compta-home.html.twig b/web/modules/custom/figli_compta_ledger/templates/figli-compta-home.html.twig index f42360c..cad309c 100644 --- a/web/modules/custom/figli_compta_ledger/templates/figli-compta-home.html.twig +++ b/web/modules/custom/figli_compta_ledger/templates/figli-compta-home.html.twig @@ -119,7 +119,7 @@ @click="toggleEntreeFilter(item.id)" >{{ reconciliationByEntree.get(item.id).count }} sortie{{ reconciliationByEntree.get(item.id).count > 1 ? 's' : '' }} liée{{ reconciliationByEntree.get(item.id).count > 1 ? 's' : '' }} - {{ formatEur(item.montant_ht) }} + {{ formatEur(item.montant_ht) }} {{ formatEur(item.montant_ttc) }} {{ item.parCompte[c] !== undefined ? formatEur(item.parCompte[c]) : '' }} {{ item.hasError ? formatEur(item.ecart) : '' }}