From: Roland Häder Date: Sat, 4 Nov 2017 11:36:18 +0000 (+0100) Subject: Don't cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=306d7f14a01c29173781c1331ac49da0000ad91b;p=jfinancials-war.git Don't cherry-pick: - receipts may also bear time when purchased, let's record this as well and java.util.Date can easily persist both, date and time, anyway. - item's manufacturer can be different to generic product manufacturer, e.g. a sound system is unlikely being rebranded but surely many different companies will produce milk (which is a generic product that needs branding) - bar codes are sometimes extremely long, even java.lang.Long was not enough to store them and I may not go to BigInteger, but maybe one day I will ... - code convention applied: in comparison, first value then variable - added brand name for receipt item Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java index 7b550545..9d8606af 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java @@ -67,7 +67,7 @@ public class FinancialAdminReceiptWebRequestBean extends BaseFinancialsBean impl /** * Bar-code number */ - private Long receiptBarCodeNumber; + private String receiptBarCodeNumber; /** * Recipient issuing company (for example where the user went shopping to) @@ -184,7 +184,7 @@ public class FinancialAdminReceiptWebRequestBean extends BaseFinancialsBean impl *

* @return Receipt's bar-code number */ - public Long getReceiptBarCodeNumber () { + public String getReceiptBarCodeNumber () { return this.receiptBarCodeNumber; } @@ -193,7 +193,7 @@ public class FinancialAdminReceiptWebRequestBean extends BaseFinancialsBean impl *

* @param receiptBarCodeNumber Receipt's bar-code number */ - public void setReceiptBarCodeNumber (final Long receiptBarCodeNumber) { + public void setReceiptBarCodeNumber (final String receiptBarCodeNumber) { this.receiptBarCodeNumber = receiptBarCodeNumber; } diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java index 1ee5fbda..16b180a9 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java @@ -82,7 +82,7 @@ public class FinancialsReceiptWebRequestBean extends BaseFinancialsBean implemen /** * Bar-code number */ - private Long receiptBarCodeNumber; + private String receiptBarCodeNumber; /** * EJB for general financial receipt purposes @@ -329,7 +329,7 @@ public class FinancialsReceiptWebRequestBean extends BaseFinancialsBean implemen *

* @return Receipt's bar-code number */ - public Long getReceiptBarCodeNumber () { + public String getReceiptBarCodeNumber () { return this.receiptBarCodeNumber; } @@ -338,7 +338,7 @@ public class FinancialsReceiptWebRequestBean extends BaseFinancialsBean implemen *

* @param receiptBarCodeNumber Receipt's bar-code number */ - public void setReceiptBarCodeNumber (final Long receiptBarCodeNumber) { + public void setReceiptBarCodeNumber (final String receiptBarCodeNumber) { this.receiptBarCodeNumber = receiptBarCodeNumber; } diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java index 34329211..298e7b12 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java @@ -24,6 +24,7 @@ import javax.enterprise.inject.Any; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jfinancials.beans.BaseFinancialsBean; import org.mxchange.jfinancials.events.receipt_item.added.ObservableReceiptItemAddedEvent; import org.mxchange.jfinancials.events.receipt_item.added.ReceiptItemAddedEvent; @@ -61,6 +62,11 @@ public class FinancialAdminReceiptItemWebRequestBean extends BaseFinancialsBean @EJB (lookup = "java:global/jfinancials-ejb/adminFinancialReceiptItem!org.mxchange.jfinancials.model.receipt_item.FinancialAdminReceiptItemSessionBeanRemote") private FinancialAdminReceiptItemSessionBeanRemote adminReceiptItemBean; + /** + * Item brand name + */ + private String itemBrandName; + /** * Fixed discount on product price (if any) */ @@ -97,6 +103,11 @@ public class FinancialAdminReceiptItemWebRequestBean extends BaseFinancialsBean */ private Float productGrossPrice; + /** + * Item manufacturer/producer + */ + private BasicData itemManufacturer; + /** * Product's net price */ @@ -162,6 +173,24 @@ public class FinancialAdminReceiptItemWebRequestBean extends BaseFinancialsBean return "add_receipt_item?faces-redirect=true"; //NOI18N } + /** + * Getter for item brand name + *

+ * @return Item brand name + */ + public String getItemBrandName () { + return this.itemBrandName; + } + + /** + * Setter for item brand name + *

+ * @param itemBrandName Item brand name + */ + public void setItemBrandName (final String itemBrandName) { + this.itemBrandName = itemBrandName; + } + /** * Getter for item discount (fixed) *

@@ -198,6 +227,24 @@ public class FinancialAdminReceiptItemWebRequestBean extends BaseFinancialsBean this.itemDiscountPercent = itemDiscountPercent; } + /** + * Getter for item manufacturer/producer + *

+ * @return Item manufacturer/producer + */ + public BasicData getItemManufacturer () { + return this.itemManufacturer; + } + + /** + * Setter for item manufacturer/producer + *

+ * @param itemManufacturer Item manufacturer/producer + */ + public void setItemManufacturer (final BasicData itemManufacturer) { + this.itemManufacturer = itemManufacturer; + } + /** * Getter for assigned product *

@@ -329,8 +376,10 @@ public class FinancialAdminReceiptItemWebRequestBean extends BaseFinancialsBean */ private void clear () { // Clear all fields + this.setItemBrandName(null); this.setItemDiscountFixed(null); this.setItemDiscountPercent(null); + this.setItemManufacturer(null); this.setItemProduct(null); this.setItemQuantity(null); this.setItemReceipt(null); @@ -346,8 +395,10 @@ public class FinancialAdminReceiptItemWebRequestBean extends BaseFinancialsBean final BillableReceiptItem receiptItem = new FinancialReceiptItem(this.getItemProduct(), this.getItemQuantity(), this.getItemReceipt()); // Set optional data + receiptItem.setItemBrandName(this.getItemBrandName()); receiptItem.setItemDiscountFixed(this.getItemDiscountFixed()); receiptItem.setItemDiscountPercent(this.getItemDiscountPercent()); + receiptItem.setItemManufacturer(this.getItemManufacturer()); // Return prepared instance return receiptItem; diff --git a/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java b/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java index 5881e619..33d444d5 100644 --- a/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java @@ -43,7 +43,7 @@ public class FinancialsReceiptConverter implements Converter { @Override public BillableReceipt getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Is the instance there? - if (RECEIPT_CONTROLLER == null) { + if (null == RECEIPT_CONTROLLER) { // Get bean from CDI directly RECEIPT_CONTROLLER = CDI.current().select(FinancialsReceiptWebRequestBean.class).get(); } diff --git a/src/java/org/mxchange/localization/project_de_DE.properties b/src/java/org/mxchange/localization/project_de_DE.properties index c9baf0b3..21991c37 100644 --- a/src/java/org/mxchange/localization/project_de_DE.properties +++ b/src/java/org/mxchange/localization/project_de_DE.properties @@ -153,6 +153,8 @@ ADMIN_ENABLE_PRODUCT_AVAILABILITY_TITLE=Waehlen Sie aus, ob das Produkt verfuegb #@TODO Please fix German umlauts! ADMIN_ENTER_PRODUCT_CURRENCY_CODE=Waehrungscode eingeben: #@TODO Please fix German umlauts! +ADMIN_ENTER_PRODUCT_CURRENCY_CODE_TITLE=Geben Sie den Waehrungscode fuer das Produkt ein. Beispiele: EUR, USD, PHP +#@TODO Please fix German umlauts! ADMIN_ENTER_PRODUCT_UNIT_AMOUNT=Produktstueckzahl eingeben: ADMIN_ENTER_PRODUCT_UNIT_AMOUNT_TITLE=Geben Sie hier die Stueckzahl des Produktes ein. Zum Beispiel 500 fuer 500 Gramm. Unter Stueckzahleinheit geben Sie dann einfach nur "g" ein. #@TODO Please fix German umlauts! @@ -189,3 +191,19 @@ ADMIN_ENABLE_CATEGORY_IN_STATISTICS=Soll die Kategorie in Statistiken auftauchen ADMIN_ENABLE_CATEGORY_IN_STATISTICS_TITLE=Waehlen Sie aus, ob diese Kategorie in Statistiken aufytauchen soll. ADMIN_ENABLE_CATEGORY_IN_STATISTICS_REQUIRED=Bitte waehlen Sie aus, ob diese Kategorie in Statistiken auftauchen soll. ENTER_RECEIPT_SEQUENCE_NUMBER=Sequenznummer eingeben: +#@TODO Please fix German umlauts! +ADMIN_ENTERED_CATEGORY_I18N_KEY_ALREADY_ADDED=Der von Ihnen eingegebene Uebersetzungsschluessel fuer die Kategorie ist bereits vorhanden. Bitte gebene Sie einen anderen an. +#@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: +#@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_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. +#@TODO Please fix German umlauts! +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. diff --git a/src/java/org/mxchange/localization/project_en_US.properties b/src/java/org/mxchange/localization/project_en_US.properties index 001d3195..4c2021ed 100644 --- a/src/java/org/mxchange/localization/project_en_US.properties +++ b/src/java/org/mxchange/localization/project_en_US.properties @@ -114,8 +114,8 @@ ADMIN_ASSIGN_PRODUCT_CATEGORY_TITLE=Choose the product category for the to be ad ADMIN_ENTER_PRODUCT_I18N_KEY_TITLE=Enter product'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: -#Geben Sie hier die Stueckzahl des Produktes ein. Zum Beispiel 500 fuer 500 Gramm. Unter Stueckzahleinheit geben Sie dann einfach nur "g" ein. 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". BUTTON_ADMIN_ADD_GENERIC_PRODUCT=Add product ADMIN_PRODUCT_CATEGORY_REQUIRED=Please choose a product category. @@ -141,3 +141,14 @@ ADMIN_ENABLE_CATEGORY_IN_STATISTICS=Enable whether category is in statistics: ADMIN_ENABLE_CATEGORY_IN_STATISTICS_TITLE=Choose if this category is enlisted in any kind of statistics. ADMIN_ENABLE_CATEGORY_IN_STATISTICS_REQUIRED=Please choose if this category should be shown in any statistics. 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_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: +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. diff --git a/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl b/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl index 72ac9d9c..77406c49 100644 --- a/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl +++ b/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl @@ -30,7 +30,10 @@ value="#{adminReceiptController.receiptIssued}" required="true" requiredMessage="#{project.ADMIN_RECEIPT_ISSUE_DATE_REQUIRED}" - pattern="#{msg.DATE_PATTERN}" + pattern="#{msg.DATE_TIME_PATTERN}" + showButtonPanel="true" + showOtherMonths="true" + showSecond="false" navigator="true" maskAutoClear="true" title="#{project.ADMIN_RECEIPT_DATE_OF_ISSUE_TITLE}" @@ -47,7 +50,7 @@ > - + @@ -92,10 +95,10 @@ - + - + diff --git a/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl b/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl index 5fdc4297..c086dca6 100644 --- a/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl +++ b/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl @@ -12,6 +12,13 @@ + + + + + + + + + + - +