*/
private Category productCategory;
+ /**
+ * Product's price currency code like EUR or USD
+ */
+ private String productCurrencyCode;
+
/**
* Product's gross price
*/
this.productCategory = productCategory;
}
+ /**
+ * Getter for product's price currency code
+ * <p>
+ * @return Product's price currency code
+ */
+ public String getProductCurrencyCode () {
+ return this.productCurrencyCode;
+ }
+
+ /**
+ * Setter for product's price currency code
+ * <p>
+ * @param productCurrencyCode Product's price currency code
+ */
+ public void setProductCurrencyCode (final String productCurrencyCode) {
+ this.productCurrencyCode = productCurrencyCode;
+ }
+
/**
* Getter for product's gross price
* <p>
*/
private Product createProductInstance () {
// Create product instance
- final Product product = new GenericProduct(this.getProductTitle(), this.getProductGrossPrice(), this.getProductCategory(), this.getProductAvailability());
+ final Product product = new GenericProduct(this.getProductTitle(), this.getProductGrossPrice(), this.getProductCurrencyCode(), this.getProductCategory(), this.getProductAvailability());
// Set all optional fields
product.setProductNetPrice(this.getProductNetPrice());
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2017 Roland Häder
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+<facelet-taglib version="2.2"
+ xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd">
+ <namespace>http://mxchange.org/jsf/jproduct/widgets</namespace>
+ <tag>
+ <tag-name>inputProductPricePanelGrid</tag-name>
+ <description>This tag renders input fields for creating a price panel grid for product prices.</description>
+ <source>resources/tags/input/panel_grid/product/product_price_input_panel_grid.tpl</source>
+ <attribute>
+ <name>rendered</name>
+ <description>Whether this tag is being rendered by JSF engine (default: true).</description>
+ <required>false</required>
+ <type>java.lang.Boolean</type>
+ </attribute>
+ <attribute>
+ <name>targetController</name>
+ <description>A target backing bean (EL code resolving into it) extending at least BaseFacesBean where to set the data in.</description>
+ <required>true</required>
+ <!-- @TODO Find an interface for BaseFacesBean and set it here instead -->
+ <type>org.mxchange.jcoreee.bean.faces.BaseFacesBean</type>
+ </attribute>
+ </tag>
+</facelet-taglib>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:p="http://primefaces.org/ui">
+
+ <!-- @TODO Hard-coded values below -->
+ <p:panelGrid layout="grid" columns="3" styleClass="table table-full ui-noborder" rendered="#{empty rendered or rendered == true}">
+ <p:inputNumber
+ id="productNetPrice"
+ value="#{targetController.productNetPrice}"
+ symbol=" EUR"
+ symbolPosition="s"
+ decimalSeparator=","
+ thousandSeparator="."
+ >
+ </p:inputNumber>
+
+ <p:inputNumber
+ id="productTaxRate"
+ value="#{targetController.productTaxRate}"
+ symbol="%"
+ symbolPosition="s"
+ decimalSeparator=","
+ emptyValue="sign"
+ >
+ <f:validateDoubleRange minimum="0" maximum="100" />
+ </p:inputNumber>
+
+ <p:inputNumber
+ id="productGrossPrice"
+ value="#{targetController.productGrossPrice}"
+ symbol=" EUR"
+ symbolPosition="s"
+ decimalSeparator=","
+ thousandSeparator="."
+ required="true"
+ requiredMessage="#{project.ADMIN_PRODUCT_GROSS_PRICE_REQUIRED}"
+ >
+ </p:inputNumber>
+ </p:panelGrid>
+</ui:composition>