2 Commits
Author SHA1 Message Date
ucef d7b62ddf15 feat: map adherent size and shoe size to dotations
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Successful in 2m40s
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 1m42s
2026-07-18 00:27:51 +02:00
ucef a577e91e94 fix: correct hx-vals JSON syntax for payments pagination 2026-07-18 00:27:51 +02:00
2 changed files with 27 additions and 4 deletions
@@ -123,6 +123,26 @@ public class CategorieService {
continue;
}
String matchedTaille = "";
if (licence.getAdherent() != null) {
String taillesDispo = ce.getEquipement().getTaillesDisponibles();
if (taillesDispo != null && !taillesDispo.trim().isEmpty()) {
String[] dispos = taillesDispo.split(",");
String tv = licence.getAdherent().getTailleVetement();
String pt = licence.getAdherent().getPointure();
for (String t : dispos) {
String trimmed = t.trim();
if (tv != null && !tv.trim().isEmpty() && trimmed.equalsIgnoreCase(tv.trim())) {
matchedTaille = tv.trim();
break;
} else if (pt != null && !pt.trim().isEmpty() && trimmed.equalsIgnoreCase(pt.trim())) {
matchedTaille = pt.trim();
break;
}
}
}
}
boolean found = false;
for (Dotation d : currentDotations) {
if (ce.getEquipement().getId().equals(d.getEquipement().getId())) {
@@ -130,6 +150,9 @@ public class CategorieService {
if (Boolean.TRUE.equals(ce.getObligatoire()) && !Boolean.TRUE.equals(d.getChoisi())) {
d.setChoisi(true);
}
if ((d.getTaille() == null || d.getTaille().trim().isEmpty()) && !matchedTaille.isEmpty()) {
d.setTaille(matchedTaille);
}
break;
}
}
@@ -146,7 +169,7 @@ public class CategorieService {
}
newDotation.setChoisi(ce.getObligatoire() || (isMaillot && isNouvelle)); // Checked if obligatoire or if it's a new registration
newDotation.setFourni(false);
newDotation.setTaille("");
newDotation.setTaille(matchedTaille);
newDotation.setNumero("");
if (licence.getAdherent() != null) {
String defaultFlocage = "";
@@ -142,7 +142,7 @@
hx-target="#paiements-table-container"
hx-select="#paiements-table-container"
hx-include="#filter-form"
th:attr="hx-vals=|{'page': ${currentPage - 1}}|"
th:attr="hx-vals=|{"page": ${currentPage - 1}}|"
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
Précédent
</button>
@@ -157,7 +157,7 @@
hx-target="#paiements-table-container"
hx-select="#paiements-table-container"
hx-include="#filter-form"
th:attr="hx-vals=|{'page': ${pageNum}}|"
th:attr="hx-vals=|{&quot;page&quot;: ${pageNum}}|"
th:text="${pageNum + 1}"
class="px-3 py-1 rounded transition-colors"
th:classappend="${currentPage == pageNum ? 'bg-blue-600 text-white' : 'border border-gray-300 hover:bg-gray-100'}">
@@ -172,7 +172,7 @@
hx-target="#paiements-table-container"
hx-select="#paiements-table-container"
hx-include="#filter-form"
th:attr="hx-vals=|{'page': ${currentPage + 1}}|"
th:attr="hx-vals=|{&quot;page&quot;: ${currentPage + 1}}|"
class="px-3 py-1 border border-gray-300 rounded hover:bg-gray-100 transition-colors">
Suivant
</button>