From: Roland Häder Date: Sat, 4 Nov 2017 13:25:47 +0000 (+0100) Subject: Maybe cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fdbaf164c15dc8f5cda47ac765429473574233a9;p=jfinancials-war.git Maybe cherry-pick: - 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 --- diff --git a/src/java/org/mxchange/jfinancials/beans/generic_product/FinancialAdminProductWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/generic_product/FinancialAdminProductWebRequestBean.java index e405fad3..6082653e 100644 --- a/src/java/org/mxchange/jfinancials/beans/generic_product/FinancialAdminProductWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/generic_product/FinancialAdminProductWebRequestBean.java @@ -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 *

* @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 *

* @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 *

- * @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 *

- * @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; diff --git a/src/java/org/mxchange/localization/project_de_DE.properties b/src/java/org/mxchange/localization/project_de_DE.properties index 21991c37..39c1dea5 100644 --- a/src/java/org/mxchange/localization/project_de_DE.properties +++ b/src/java/org/mxchange/localization/project_de_DE.properties @@ -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. diff --git a/src/java/org/mxchange/localization/project_en_US.properties b/src/java/org/mxchange/localization/project_en_US.properties index 4c2021ed..c6fd9879 100644 --- a/src/java/org/mxchange/localization/project_en_US.properties +++ b/src/java/org/mxchange/localization/project_en_US.properties @@ -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. diff --git a/web/WEB-INF/templates/admin/generic_product/admin_form_product_data.tpl b/web/WEB-INF/templates/admin/generic_product/admin_form_product_data.tpl index 772b573a..c6abe4d7 100644 --- a/web/WEB-INF/templates/admin/generic_product/admin_form_product_data.tpl +++ b/web/WEB-INF/templates/admin/generic_product/admin_form_product_data.tpl @@ -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}" /> @@ -81,15 +83,19 @@ decimalSeparator="," thousandSeparator="." title="#{project.ADMIN_ENTER_PRODUCT_UNIT_AMOUNT_TITLE}" + required="true" + requiredMessage="#{project.ADMIN_PRODUCT_UNIT_AMOUNT_REQUIRED}" /> - + diff --git a/web/admin/generic_product/admin_generic_product_list.xhtml b/web/admin/generic_product/admin_generic_product_list.xhtml index 65d3bbee..0b9e47f6 100644 --- a/web/admin/generic_product/admin_generic_product_list.xhtml +++ b/web/admin/generic_product/admin_generic_product_list.xhtml @@ -88,7 +88,7 @@ - + - + - + + + - +