style: display total due, paid, and remaining balance in adherents list
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user