feat(paiement): gestion specifique du mode Cheque Sport mairie (masquage num cheque, option remis oui/non, calcul reste a payer)
This commit is contained in:
@@ -141,6 +141,7 @@ public class Licence {
|
||||
}
|
||||
|
||||
BigDecimal totalPaye = paiements.stream()
|
||||
.filter(p -> p.getRemis() == null || Boolean.TRUE.equals(p.getRemis()))
|
||||
.map(Paiement::getMontant)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
@@ -154,6 +155,7 @@ public class Licence {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return paiements.stream()
|
||||
.filter(p -> p.getRemis() == null || Boolean.TRUE.equals(p.getRemis()))
|
||||
.map(Paiement::getMontant)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,9 @@ public class Paiement {
|
||||
@Column(name = "commentaire", columnDefinition = "TEXT")
|
||||
private String commentaire;
|
||||
|
||||
@Column(name = "remis", nullable = false)
|
||||
private Boolean remis = true;
|
||||
|
||||
// Getters and Setters
|
||||
|
||||
public Long getId() { return id; }
|
||||
@@ -60,4 +63,7 @@ public class Paiement {
|
||||
|
||||
public String getCommentaire() { return commentaire; }
|
||||
public void setCommentaire(String commentaire) { this.commentaire = commentaire; }
|
||||
|
||||
public Boolean getRemis() { return remis != null ? remis : true; }
|
||||
public void setRemis(Boolean remis) { this.remis = remis != null ? remis : true; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE paiement ADD COLUMN IF NOT EXISTS remis BOOLEAN NOT NULL DEFAULT TRUE;
|
||||
|
||||
INSERT INTO mode_paiement (nom) VALUES ('Chèque Sport mairie')
|
||||
ON CONFLICT (nom) DO NOTHING;
|
||||
Reference in New Issue
Block a user