From 1a4ff6fdac2f36a43def534b59eead4a641e7409 Mon Sep 17 00:00:00 2001 From: Youssef Date: Mon, 1 Jun 2026 22:58:41 +0200 Subject: [PATCH] style: display total due, paid, and remaining balance in adherents list --- .../com/astalange/core/entity/Licence.java | 10 ++++++ .../resources/templates/adherents/list.html | 33 ++++++++++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java b/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java index d86bf03..93715ff 100644 --- a/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java +++ b/as-talange-core/src/main/java/com/astalange/core/entity/Licence.java @@ -83,6 +83,16 @@ public class Licence { return reste.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : reste; } + @Transient + public BigDecimal getSommePayee() { + if (paiements == null || paiements.isEmpty()) { + return BigDecimal.ZERO; + } + return paiements.stream() + .map(Paiement::getMontant) + .reduce(BigDecimal.ZERO, BigDecimal::add); + } + // Getters and Setters public Long getId() { return id; } diff --git a/as-talange-web/src/main/resources/templates/adherents/list.html b/as-talange-web/src/main/resources/templates/adherents/list.html index 1f61dd3..d6dfd42 100644 --- a/as-talange-web/src/main/resources/templates/adherents/list.html +++ b/as-talange-web/src/main/resources/templates/adherents/list.html @@ -120,10 +120,35 @@ th:text="${adherent.getLicenceActuelle() != null and adherent.getLicenceActuelle().numeroLicence != null and !adherent.getLicenceActuelle().numeroLicence.isEmpty() ? adherent.getLicenceActuelle().numeroLicence : '-'}">- jean@example.com 0600000000 - - À jour + + +
+ Aucune licence +
+ +
+ + + À jour + + +
+
+ Dû: + 150 € +
+
+ Payé: + 100 € +
+
+ Reste: + 50 € +
+
+
Voir / Modifier