]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Maybe cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 4 Nov 2017 13:25:47 +0000 (14:25 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 4 Nov 2017 13:25:47 +0000 (14:25 +0100)
- renamed productUnitType -> productUnitI18nKey
- product's currency code, unit amount and unit's i18n key are now all required
  (non-nullable) fields
- therefor they have been moved into constructor invocation and not "externally"
  being set
- fixed message bundle, PRODUCT_FOO is alway "project" not "msg" (generic)
- fixed/added missing i18n strings
- tpzo fixed: PROJECT -> PRODUCT (ops)

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/generic_product/FinancialAdminProductWebRequestBean.java
src/java/org/mxchange/localization/project_de_DE.properties
src/java/org/mxchange/localization/project_en_US.properties
web/WEB-INF/templates/admin/generic_product/admin_form_product_data.tpl
web/admin/generic_product/admin_generic_product_list.xhtml

index e405fad363d6a4e77c444c1bddd36a79280ba42c..6082653ea5a29fa89a7595b836fd9758389958c4 100644 (file)
@@ -112,9 +112,9 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl
        private Float productUnitAmount;
 
        /**
-        * Product's unit type
+        * Product's i18n key
         */
-       private String productUnitType;
+       private String productUnitI18nKey;
 
        /**
         * Default constructor
@@ -284,7 +284,7 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl
        }
 
        /**
-        * Getter for product's i18n key
+        * Getter for product unit's i18n key
         * <p>
         * @return Product's i18n key
         */
@@ -293,7 +293,7 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl
        }
 
        /**
-        * Setter for product's i18n key
+        * Setter for product unit's i18n key
         * <p>
         * @param productI18nKey Product's i18n key
         */
@@ -320,21 +320,21 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl
        }
 
        /**
-        * Getter for product's unit type
+        * Getter for product unit's i18n key
         * <p>
-        * @return Product's unit type
+        * @return Product's i18n key
         */
-       public String getProductUnitType () {
-               return this.productUnitType;
+       public String getProductUnitI18nKey () {
+               return this.productUnitI18nKey;
        }
 
        /**
-        * Setter for product's unit type
+        * Setter for product unit's i18n key
         * <p>
-        * @param productUnitType Product's unit type
+        * @param productI18nKey Product's i18n key
         */
-       public void setProductUnitType (final String productUnitType) {
-               this.productUnitType = productUnitType;
+       public void setProductUnitI18nKey (final String productUnitI18nKey) {
+               this.productUnitI18nKey = productUnitI18nKey;
        }
 
        /**
@@ -349,7 +349,7 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl
                this.setProductManufacturer(null);
                this.setProductTaxRate(null);
                this.setProductUnitAmount(null);
-               this.setProductUnitType(null);
+               this.setProductUnitI18nKey(null);
        }
 
        /**
@@ -359,14 +359,12 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl
         */
        private Product createProductInstance () {
                // Create product instance
-               final Product product = new GenericProduct(this.getProductI18nKey(), this.getProductGrossPrice(), this.getProductCurrencyCode(), this.getProductCategory(), this.getProductAvailability());
+               final Product product = new GenericProduct(this.getProductI18nKey(), this.getProductGrossPrice(), this.getProductCurrencyCode(), this.getProductCategory(), this.getProductAvailability(), this.getProductUnitAmount(), this.getProductUnitI18nKey());
 
                // Set all optional fields
                product.setProductNetPrice(this.getProductNetPrice());
                product.setProductManufacturer(this.getProductManufacturer());
                product.setProductTaxRate(this.getProductTaxRate());
-               product.setProductUnitAmount(this.getProductUnitAmount());
-               product.setProductUnitType(this.getProductUnitType());
 
                // Return it
                return product;
index 21991c37e17603ccb6b07694381794b980e24ad6..39c1dea5cc7a1fe4c73d12e9e12aa67922a26ba6 100644 (file)
@@ -196,9 +196,9 @@ ADMIN_ENTERED_CATEGORY_I18N_KEY_ALREADY_ADDED=Der von Ihnen eingegebene Ueberset
 #@TODO Please fix German umlauts!
 ADMIN_ENTERED_PRODUCT_I18N_KEY_ALREADY_ADDED=Der von Ihnen eingegebene Uebersetzungsschluessel fuer das Produkt ist bereits vorhanden. Bitte gebene Sie einen anderen an.
 #@TODO Please fix German umlauts!
-ADMIN_ENTER_PRODUCT_UNIT_TYPE=Einheit fuer Stueckzahl eingeben:
+ADMIN_ENTER_PRODUCT_UNIT_I18N_KEY=Uebersetzungschluessel der Einheit fuer Stueckzahl eingeben:
 #@TODO Please fix German umlauts!
-ADMIN_ENTER_PRODUCT_UNIT_TYPE_TITLE=Geben Sie hier die Einheit fuer die Produktstueckzahl ein, wie z.B. "l" fuer Liter oder "kg" fuer Kilogramm.
+ADMIN_ENTER_PRODUCT_UNIT_I18N_KEY_TITLE=Geben Sie hier die Einheit fuer die Produktstueckzahl ein, wie z.B. "l" fuer Liter oder "kg" fuer Kilogramm.
 ADMIN_ASSIGN_PRODUCT_MANUFACTURER=Produktehersteller dem Produkt zuweisen:
 #@TODO Please fix German umlauts!
 ADMIN_ASSIGN_PRODUCT_MANUFACTURER_TITLE=Zweisen Sie hier ein Hersteller dem Produkt zu. Supermaerke verkaufen oefters nur die Produkte, die ein anderes Unternehmen hergestellt hat.
@@ -207,3 +207,10 @@ SELECT_RECEIPT_ITEM_MANUFACTURER=Hersteller zum Kassenboneintrah auswaehlen:
 ADMIN_HEADER_RECEIPT_ITEM_MANUFACTURER_NAME=Hersteller des Boneintrages:
 ENTER_RECEIPT_ITEM_BRAND_NAME=Warenzeichen/Marke eingeben:
 ENTER_RECEIPT_ITEM_BRAND_NAME_TITLE=Geben Sie das Warenzeichen ein, dass Sie auf dem Kassenbon finden.
+ADMIN_PRODUCT_CURRENCY_CODE_REQUIRED=Bitte geben Sie den Waehrungscode fuer das Produkt ein. Beispiele: EUR, USD, PHP
+#@TODO Please fix German umlauts!
+ADMIN_PRODUCT_UNIT_AMOUNT_REQUIRED=Bitte geben Sie die Stueckanzahl des Produktes ein. Beispiel: 500 fuer 500g
+#@TODO Please fix German umlauts!
+ADMIN_PRODUCT_UNIT_I18N_KEY_REQUIRED=Bitte geben Sie den Uebersetzungschluessel zur Stueckzahl ein. Beispiel: UNIT_TYPE_GRAMS fuer Gramm
+ADMIN_HEADER_PRODUCT_MANUFACTURER_NAME=Produktehersteller:
+ADMIN_NO_PRODUCT_MANUFACTURER_ASSIGNED_TITLE=Es ist kein Hersteller dem Produkt zugewiesen.
index 4c2021edd22f0caf1d71215c2bb0ab85d21aec10..c6fd9879513a6d8071e46cd1abb137ccd969a8bc 100644 (file)
@@ -111,12 +111,12 @@ ADMIN_ASSIGN_PRODUCT_CATEGORY=Assign category to product:
 ADMIN_ENTER_PRODUCT_I18N_KEY=Enter product's i8n key:
 ADMIN_ENABLE_PRODUCT_AVAILABILITY=Is the product available:
 ADMIN_ASSIGN_PRODUCT_CATEGORY_TITLE=Choose the product category for the to be added product.
-ADMIN_ENTER_PRODUCT_I18N_KEY_TITLE=Enter product's i18n key. This must be unique.
+ADMIN_ENTER_PRODUCT_I18N_KEY_TITLE=Enter product unit's i18n key. This must be unique.
 ADMIN_ENABLE_PRODUCT_AVAILABILITY_TITLE=Choose if the product is available/active.
 ADMIN_ENTER_PRODUCT_CURRENCY_CODE=Enter currency code:
 ADMIN_ENTER_PRODUCT_CURRENCY_CODE=Enter currency code:
 ADMIN_ENTER_PRODUCT_UNIT_AMOUNT=Enter product's unit amount:
-ADMIN_ENTER_PRODUCT_UNIT_AMOUNT_TITLE=Enter the product's unit amount. For example 500 for 500 grams. Under unit type, then just enter "g".
+ADMIN_ENTER_PRODUCT_UNIT_AMOUNT_TITLE=Enter the product's unit amount. For example 500 for 500 grams. Under i18n key, then just enter "g".
 BUTTON_ADMIN_ADD_GENERIC_PRODUCT=Add product
 ADMIN_PRODUCT_CATEGORY_REQUIRED=Please choose a product category.
 ADMIN_PRODUCT_I18N_KEY_REQUIRED=Please enter a product i18n key.
@@ -143,8 +143,8 @@ ADMIN_ENABLE_CATEGORY_IN_STATISTICS_REQUIRED=Please choose if this category shou
 ENTER_RECEIPT_SEQUENCE_NUMBER=Enter sequence number:
 ADMIN_ENTERED_CATEGORY_I18N_KEY_ALREADY_ADDED=Your entered category i18n key is already added. Please enter an other one.
 ADMIN_ENTERED_PRODUCT_I18N_KEY_ALREADY_ADDED=Your entered product i18n key is already added. Please enter an other one.
-ADMIN_ENTER_PRODUCT_UNIT_TYPE=Enter product's unit type:
-ADMIN_ENTER_PRODUCT_UNIT_TYPE_TITLE=Enter the product's unit type, like "l" for liter or "kg" for kilo grams.
+ADMIN_ENTER_PRODUCT_UNIT_I18N_KEY=Enter product unit's i18n key:
+ADMIN_ENTER_PRODUCT_UNIT_I18N_KEY_TITLE=Enter the product unit's i18n key, like "l" for liter or "kg" for kilo grams.
 ADMIN_ASSIGN_PRODUCT_MANUFACTURER=Assign product's manufacturing/producing company:
 ADMIN_ASSIGN_PRODUCT_MANUFACTURER_TITLE=Assign a manufacturing/producing company to this product. Supermarkets are often only selling products other companies have produced.
 SELECT_RECEIPT_ITEM_MANUFACTURER=Choose manufacturer for receipt item:
@@ -152,3 +152,8 @@ ADMIN_HEADER_RECEIPT_ITEM_MANUFACTURER_NAME=Manufacturer of product item:
 ADMIN_ENTER_PRODUCT_CURRENCY_CODE_TITLE=Enter the currency code for product. Examples: EUR, USD, PHP
 ENTER_RECEIPT_ITEM_BRAND_NAME=Enter item's brand name:
 ENTER_RECEIPT_ITEM_BRAND_NAME_TITLE=Enter the item's brand name found on receipt.
+ADMIN_PRODUCT_CURRENCY_CODE_REQUIRED=Please enter current code for product. Example: EUR, USD, PHP
+ADMIN_PRODUCT_UNIT_AMOUNT_REQUIRED=Please enter a unit amount. Example 500 for 500 grams.
+ADMIN_PRODUCT_UNIT_I18N_KEY_REQUIRED=Please enter unit's i18n key. Example: UNIT_TYPE_GRAMS for grams
+ADMIN_HEADER_PRODUCT_MANUFACTURER_NAME=Product manufacturer:
+ADMIN_NO_PRODUCT_MANUFACTURER_ASSIGNED_TITLE=No manufacturer is assigned with this product.
index 772b573a1b07337d8607a66bb163ba54613fccf6..c6abe4d70d69ed5f32261ae041a8d2a6c15a2945 100644 (file)
@@ -58,7 +58,7 @@
                                id="productAvailability"
                                value="#{adminProductController.productAvailability}"
                                required="true"
-                               requiredMessage="#{project.ADMIN_GENERIC_PROJECT_AVAILABILITY_REQUIRED}"
+                               requiredMessage="#{project.ADMIN_GENERIC_PRODUCT_AVAILABILITY_REQUIRED}"
                                title="#{project.ADMIN_ENABLE_PRODUCT_AVAILABILITY_TITLE}"
                                />
 
@@ -72,6 +72,8 @@
                                size="3"
                                maxlength="3"
                                title="#{project.ADMIN_ENTER_PRODUCT_CURRENCY_CODE_TITLE}"
+                               required="true"
+                               requiredMessage="#{project.ADMIN_PRODUCT_CURRENCY_CODE_REQUIRED}"
                                />
 
                        <p:outputLabel for="productUnitAmount" value="#{project.ADMIN_ENTER_PRODUCT_UNIT_AMOUNT}" />
                                decimalSeparator=","
                                thousandSeparator="."
                                title="#{project.ADMIN_ENTER_PRODUCT_UNIT_AMOUNT_TITLE}"
+                               required="true"
+                               requiredMessage="#{project.ADMIN_PRODUCT_UNIT_AMOUNT_REQUIRED}"
                                />
 
-                       <p:outputLabel for="productUnitType" value="#{project.ADMIN_ENTER_PRODUCT_UNIT_TYPE}" />
+                       <p:outputLabel for="productUnitI18nKey" value="#{project.ADMIN_ENTER_PRODUCT_UNIT_I18N_KEY}" />
                        <p:inputText
-                               id="productUnitType"
-                               value="#{adminProductController.productUnitType}"
+                               id="productUnitI18nKey"
+                               value="#{adminProductController.productUnitI18nKey}"
                                size="10"
                                maxlength="255"
-                               title="#{project.ADMIN_ENTER_PRODUCT_UNIT_TYPE_TITLE}"
+                               title="#{project.ADMIN_ENTER_PRODUCT_UNIT_I18N_KEY_TITLE}"
+                               required="true"
+                               requiredMessage="#{project.ADMIN_PRODUCT_UNIT_I18N_KEY_REQUIRED}"
                                />
                </p:panelGrid>
        </p:fieldset>
index 65d3bbee52040e5a763d9e1fef2d85c73e083c42..0b9e47f6956813f63bf164641ec68169c02b0bb0 100644 (file)
@@ -88,7 +88,7 @@
                                        <h:outputText value="#{product.productAvailability ? msg.CHOICE_YES : msg.CHOICE_NO}" />
                                </p:column>
 
-                               <p:column headerText="#{msg.ADMIN_HEADER_PRODUCT_MANUFACTURER_NAME}" sortBy="#{product.productManufacturer.companyName}" filterBy="#{product.productManufacturer}" filterMatchMode="in">
+                               <p:column headerText="#{project.ADMIN_HEADER_PRODUCT_MANUFACTURER_NAME}" sortBy="#{product.productManufacturer.companyName}" filterBy="#{product.productManufacturer}" filterMatchMode="in">
                                        <f:facet name="filter">
                                                <p:selectCheckboxMenu
                                                        filter="true"
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <h:outputLink value="#{product.productManufacturer.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty product.productManufacturer.companyWebsiteUrl}">
+                                       <p:link
+                                               href="#{product.productManufacturer.companyWebsiteUrl}"
+                                               target="_blank"
+                                               title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}"
+                                               rel="external"
+                                               rendered="#{not empty product.productManufacturer.companyWebsiteUrl and not empty product.productManufacturer.companyName}"
+                                               >
                                                <h:outputText value="#{product.productManufacturer.companyName}" />
-                                       </h:outputLink>
+                                       </p:link>
+
+                                       <h:outputText value="#{product.productManufacturer.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty product.productManufacturer.companyWebsiteUrl and not empty product.productManufacturer.companyName}" />
 
-                                       <h:outputText value="#{product.productManufacturer.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty product.productManufacturer.companyWebsiteUrl}" />
+                                       <h:outputText value="#{msg.ADMIN_NOT_ASSIGNED}" title="#{project.ADMIN_NO_PRODUCT_MANUFACTURER_ASSIGNED_TITLE}" rendered="#{empty product.productManufacturer}" />
                                </p:column>
 
                                <p:column headerText="#{msg.ADMIN_HEADER_ENTRY_CREATED}" sortBy="#{product.productCreated}" filterable="false">