From: Roland Häder Date: Sat, 24 Mar 2018 18:22:35 +0000 (+0100) Subject: Product-only: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9ad2e6fb17f412e644d19731f23b953fd41d9994;p=jfinancials-war.git Product-only: - also output project's number, age-group and size - added getter for all age groups to "static" data bean Signed-off-by: Roland Häder --- 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