From 9ad2e6fb17f412e644d19731f23b953fd41d9994 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 24 Mar 2018 19:22:35 +0100 Subject: [PATCH] Product-only: - also output project's number, age-group and size - added getter for all age groups to "static" data bean MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../FinancialsDataWebApplicationBean.java | 10 ++++++++ .../FinancialsWebRequestHelperBean.java | 24 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/java/org/mxchange/jfinancials/beans/data/FinancialsDataWebApplicationBean.java b/src/java/org/mxchange/jfinancials/beans/data/FinancialsDataWebApplicationBean.java index 6b5ae377..7c40f4a1 100644 --- a/src/java/org/mxchange/jfinancials/beans/data/FinancialsDataWebApplicationBean.java +++ b/src/java/org/mxchange/jfinancials/beans/data/FinancialsDataWebApplicationBean.java @@ -22,6 +22,7 @@ import org.mxchange.jcontacts.model.contact.title.PersonalTitle; import org.mxchange.jcontactsbusiness.model.opening_time.dayofweek.DayOfTheWeek; import org.mxchange.jfinancials.beans.BaseFinancialsBean; import org.mxchange.jproduct.model.payment.PaymentType; +import org.mxchange.jproduct.model.product.agegroup.AgeGroup; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; import org.mxchange.jusercore.model.user.status.UserAccountStatus; @@ -47,6 +48,15 @@ public class FinancialsDataWebApplicationBean extends BaseFinancialsBean { super(); } + /** + * Returns an array with all age groups + *

+ * @return An array with all age groups + */ + public AgeGroup[] getAgeGroups() { + return AgeGroup.values(); + } + /** * Returns an array of all days of the week *

diff --git a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java index 367f38eb..80128ef3 100644 --- a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java +++ b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java @@ -619,10 +619,32 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement // Is a product set? if (product instanceof Product) { + // Is product number given? + if (product.getProductNumber() != null) { + // Prepend it + sb.append(this.getMessageFromBundle("NUMBER")).append(" "); //NOI18N + sb.append(product.getProductNumber()); + sb.append(", "); //NOI18N + } + // Add name and price sb.append(this.getMessageFromBundle(product.getProductI18nKey())); + + // Is there any age group? + if (product.getProductAgeGroup() != null) { + // Show it + sb.append(", ").append(this.getMessageFromBundle(product.getProductAgeGroup().getI18nKey())); //NOI18N + } + + // Is there any size? + if ((product.getProductSize() != null) && (!product.getProductSize().isEmpty())) { + // Show size + sb.append(", ").append(this.getMessageFromBundle("SIZE")).append(product.getProductSize()); //NOI18N + } + + // Add price sb.append(" ("); //NOI18N - sb.append(this.localizationController.formatCurrency(product.getProductGrossPrice())); + sb.append(this.localizationController.formatCurrency(product.getProductGrossPrice().floatValue())); sb.append(" "); //NOI18N sb.append(product.getProductCurrencyCode()); sb.append(")"); //NOI18N -- 2.39.5