fix: apply maillot price and default selection for all new registrations
This commit is contained in:
@@ -138,14 +138,13 @@ public class CategorieService {
|
|||||||
newDotation.setLicence(licence);
|
newDotation.setLicence(licence);
|
||||||
newDotation.setEquipement(ce.getEquipement());
|
newDotation.setEquipement(ce.getEquipement());
|
||||||
boolean isMaillot = "Maillot".equalsIgnoreCase(ce.getEquipement().getNom());
|
boolean isMaillot = "Maillot".equalsIgnoreCase(ce.getEquipement().getNom());
|
||||||
boolean isNouvelleAndU11 = false;
|
boolean isNouvelle = false;
|
||||||
if (licence.getTypeDemande() != null &&
|
if (licence.getTypeDemande() != null &&
|
||||||
(licence.getTypeDemande().equalsIgnoreCase("Nouvelle demande") || licence.getTypeDemande().equalsIgnoreCase("NOUVELLE")) &&
|
(licence.getTypeDemande().equalsIgnoreCase("Nouvelle demande") || licence.getTypeDemande().equalsIgnoreCase("NOUVELLE")) &&
|
||||||
licence.getCategorie() != null &&
|
licence.getCategorie() != null) {
|
||||||
licence.getCategorie().isU11OrBelow()) {
|
isNouvelle = true;
|
||||||
isNouvelleAndU11 = true;
|
|
||||||
}
|
}
|
||||||
newDotation.setChoisi(ce.getObligatoire() || (isMaillot && isNouvelleAndU11)); // Checked if obligatoire or if it's a new registration for U11 or below
|
newDotation.setChoisi(ce.getObligatoire() || (isMaillot && isNouvelle)); // Checked if obligatoire or if it's a new registration
|
||||||
newDotation.setFourni(false);
|
newDotation.setFourni(false);
|
||||||
newDotation.setTaille("");
|
newDotation.setTaille("");
|
||||||
newDotation.setNumero("");
|
newDotation.setNumero("");
|
||||||
|
|||||||
+6
-6
@@ -133,9 +133,9 @@ public class PublicInscriptionController {
|
|||||||
if (!categories.isEmpty()) {
|
if (!categories.isEmpty()) {
|
||||||
Categorie cat = categories.get(0);
|
Categorie cat = categories.get(0);
|
||||||
if (cat.getTarifBase() != null) {
|
if (cat.getTarifBase() != null) {
|
||||||
BigDecimal prixMaillot = BigDecimal.ZERO;
|
BigDecimal prixMaillot = cat.getEquipementPrixByNom("Maillot");
|
||||||
if (cat.isU11OrBelow()) {
|
if (prixMaillot == null) {
|
||||||
prixMaillot = cat.getEquipementPrixByNom("Maillot");
|
prixMaillot = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
BigDecimal tarifTotal = cat.getTarifBase().add(prixMaillot);
|
BigDecimal tarifTotal = cat.getTarifBase().add(prixMaillot);
|
||||||
tarifStr = tarifTotal.intValue() + " €";
|
tarifStr = tarifTotal.intValue() + " €";
|
||||||
@@ -175,9 +175,9 @@ public class PublicInscriptionController {
|
|||||||
|
|
||||||
Categorie cat = categories.get(0);
|
Categorie cat = categories.get(0);
|
||||||
if (cat.getTarifBase() != null) {
|
if (cat.getTarifBase() != null) {
|
||||||
BigDecimal prixMaillot = BigDecimal.ZERO;
|
BigDecimal prixMaillot = cat.getEquipementPrixByNom("Maillot");
|
||||||
if (cat.isU11OrBelow()) {
|
if (prixMaillot == null) {
|
||||||
prixMaillot = cat.getEquipementPrixByNom("Maillot");
|
prixMaillot = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
BigDecimal tarifTotal = cat.getTarifBase().add(prixMaillot);
|
BigDecimal tarifTotal = cat.getTarifBase().add(prixMaillot);
|
||||||
return tarifTotal.intValue() + " €";
|
return tarifTotal.intValue() + " €";
|
||||||
|
|||||||
Reference in New Issue
Block a user