]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Product-only:
authorRoland Häder <roland@mxchange.org>
Sat, 24 Mar 2018 18:22:35 +0000 (19:22 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 24 Mar 2018 18:22:35 +0000 (19:22 +0100)
- 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 <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/data/FinancialsDataWebApplicationBean.java
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java

index 6b5ae377936cb7bf5c1eed188f80d32726a91c05..7c40f4a1ce7648f62cfd143c0c2b485e6d70709f 100644 (file)
@@ -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
+        * <p>
+        * @return An array with all age groups
+        */
+       public AgeGroup[] getAgeGroups() {
+               return AgeGroup.values();
+       }
+
        /**
         * Returns an array of all days of the week
         * <p>
index 367f38ebeb53f860baf3d7bb714caf848f7d1618..80128ef33ca494e33383658347cd6db7c4901581 100644 (file)
@@ -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