From 22f57379e580beef694abe52e9979584b1eadfbd Mon Sep 17 00:00:00 2001 From: bach Date: Sun, 6 Sep 2026 18:10:25 +0200 Subject: [PATCH] =?UTF-8?q?Add=20solde=20footer=20to=20the=20"Lignes=20sig?= =?UTF-8?q?nal=C3=A9es"=20table=20on=20/dashboard/compte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sum of the Montant column across every flagged line for the selected compte, styled red when negative -- same convention as the other reconciliation tables' footers on this page. Co-Authored-By: Claude Sonnet 5 --- .../custom/figli_compta_ledger/js/dashboard-compte.js | 8 ++++++++ .../templates/figli-compta-dashboard-compte.html.twig | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/web/modules/custom/figli_compta_ledger/js/dashboard-compte.js b/web/modules/custom/figli_compta_ledger/js/dashboard-compte.js index b7679fe..e893bba 100644 --- a/web/modules/custom/figli_compta_ledger/js/dashboard-compte.js +++ b/web/modules/custom/figli_compta_ledger/js/dashboard-compte.js @@ -302,6 +302,14 @@ .filter((r) => r.hasFlag && r.parCompte[this.selectedCompte] !== undefined) .sort((a, b) => (b.date || '').localeCompare(a.date || '')); }, + // Solde net des lignes signalées elles-mêmes (entrées reçues moins + // versements sortis, pour ce compte) -- pas un total "reste dû" + // comme totalResteAVerser ci-dessous, juste la somme des montants + // affichés dans le tableau, pour avoir une idée de l'ampleur de ce + // qui est signalé. + totalLignesSignalees() { + return Math.round(this.lignesSignalees.reduce((sum, r) => sum + r.parCompte[this.selectedCompte], 0) * 100) / 100; + }, totalResteAVerser() { return Math.round(this.resteAVerserPositif.reduce((sum, r) => sum + r.residual, 0) * 100) / 100; }, diff --git a/web/modules/custom/figli_compta_ledger/templates/figli-compta-dashboard-compte.html.twig b/web/modules/custom/figli_compta_ledger/templates/figli-compta-dashboard-compte.html.twig index 522429d..a964041 100644 --- a/web/modules/custom/figli_compta_ledger/templates/figli-compta-dashboard-compte.html.twig +++ b/web/modules/custom/figli_compta_ledger/templates/figli-compta-dashboard-compte.html.twig @@ -123,6 +123,12 @@ {{ formatEur(r.parCompte[selectedCompte]) }} + + + Solde + {{ formatEur(totalLignesSignalees) }} + +