import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jproduct.events.category.AddedCategoryEvent;
import org.mxchange.jproduct.events.category.CategoryAddedEvent;
-import org.mxchange.jproduct.exceptions.CannotAddCategoryException;
-import org.mxchange.jproduct.exceptions.CategoryTitleAlreadyUsedException;
+import org.mxchange.jproduct.exceptions.category.CategoryAlreadyAddedException;
import org.mxchange.jproduct.model.category.AdminCategorySessionBeanRemote;
import org.mxchange.jproduct.model.category.Category;
import org.mxchange.jproduct.model.category.ProductCategory;
// Unset all older values
this.clear();
- } catch (final CategoryTitleAlreadyUsedException | CannotAddCategoryException ex) {
+ } catch (final CategoryAlreadyAddedException ex) {
// Continue to throw
throw new FaceletException(ex);
}
import javax.inject.Named;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jproduct.events.category.AddedCategoryEvent;
+import org.mxchange.jproduct.exceptions.category.CategoryNotFoundException;
import org.mxchange.jproduct.model.category.Category;
import org.mxchange.jproduct.model.category.CategorySessionBeanRemote;
return this.allCategories;
}
+ @Override
+ public Category findCategoryById (final Long categoryId) throws CategoryNotFoundException {
+ // Validate parameter
+ if (null == categoryId) {
+ // Throw NPE
+ throw new NullPointerException("categoryId is null"); //NOI18N
+ } else if (categoryId < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException("categoryId=" + categoryId + " is invalid"); //NOI18N
+ } else if (!this.categoryCache.containsKey(categoryId)) {
+ // Not found
+ throw new CategoryNotFoundException(categoryId);
+ }
+
+ // Get it from cache
+ final Category category = this.categoryCache.get(categoryId);
+
+ // Return it
+ return category;
+ }
+
/**
* Initialization of this bean
*/
package org.mxchange.jfinancials.beans.category;
import java.io.Serializable;
+import org.mxchange.jproduct.exceptions.category.CategoryNotFoundException;
+import org.mxchange.jproduct.model.category.Category;
/**
* An interface for (product) categories
*/
public interface FinancialCategoryWebRequestController extends Serializable {
+ /**
+ * Returns a category instance (entity) for given primary key. If not found,
+ * a proper exception is thrown.
+ * <p>
+ * @param categoryId Category id (primary key)
+ * <p>
+ * @return Category entity matching to primary key
+ * <p>
+ * @throws CategoryNotFoundException If a category with given primary key
+ * could not be found
+ */
+ Category findCategoryById (final Long categoryId) throws CategoryNotFoundException;
+
}
import javax.inject.Inject;
import javax.inject.Named;
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jfinancials.events.receipt.added.ObservableReceiptAddedEvent;
import org.mxchange.jfinancials.events.receipt.added.ReceiptAddedEvent;
import org.mxchange.jfinancials.model.receipt.FinancialReceipt;
import org.mxchange.jproduct.model.payment.PaymentType;
import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
/**
* An administrative backing bean for receipts
/**
* Selling employee
*/
- private Employee receiptSellerEmployee;
+ private Employable receiptSellerEmployee;
/**
* User who "owns" this receipt
* <p>
* @return Receipt seller employee
*/
- public Employee getReceiptSellerEmployee () {
+ public Employable getReceiptSellerEmployee () {
return this.receiptSellerEmployee;
}
* <p>
* @param receiptSellerEmployee Receipt seller employee
*/
- public void setReceiptSellerEmployee (final Employee receiptSellerEmployee) {
+ public void setReceiptSellerEmployee (final Employable receiptSellerEmployee) {
this.receiptSellerEmployee = receiptSellerEmployee;
}
import javax.inject.Inject;
import javax.inject.Named;
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
import org.mxchange.jfinancials.events.receipt.added.ObservableReceiptAddedEvent;
import org.mxchange.jfinancials.events.receipt.added.ReceiptAddedEvent;
import org.mxchange.jfinancials.exceptions.receipt.ReceiptAlreadyAddedException;
+import org.mxchange.jfinancials.exceptions.receipt.ReceiptNotFoundException;
import org.mxchange.jfinancials.model.receipt.BillableReceipt;
import org.mxchange.jfinancials.model.receipt.FinancialReceipt;
import org.mxchange.jfinancials.model.receipt.FinancialReceiptSessionBeanRemote;
/**
* Selling employee
*/
- private Employee receiptSellerEmployee;
+ private Employable receiptSellerEmployee;
/**
* User instance
return this.allReceipts;
}
+ @Override
+ public BillableReceipt findReceiptById (final Long receiptId) throws ReceiptNotFoundException {
+ // Validate parameter
+ if (null == receiptId) {
+ // Throw NPE
+ throw new NullPointerException("receiptId is null"); //NOI18N
+ } else if (receiptId < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException("receiptId=" + receiptId + " is invalid."); //NOI18N
+ } else if (!this.receiptCache.containsKey(receiptId)) {
+ // Not found
+ throw new ReceiptNotFoundException(receiptId);
+ }
+
+ // Get it from cache
+ final BillableReceipt receipt = this.receiptCache.get(receiptId);
+
+ // Return it
+ return receipt;
+ }
+
/**
* Getter for filtered receipts
* <p>
* <p>
* @return Receipt seller employee
*/
- public Employee getReceiptSellerEmployee () {
+ public Employable getReceiptSellerEmployee () {
return this.receiptSellerEmployee;
}
* <p>
* @param receiptSellerEmployee Receipt seller employee
*/
- public void setReceiptSellerEmployee (final Employee receiptSellerEmployee) {
+ public void setReceiptSellerEmployee (final Employable receiptSellerEmployee) {
this.receiptSellerEmployee = receiptSellerEmployee;
}
package org.mxchange.jfinancials.beans.financial.model.receipt;
import java.io.Serializable;
+import org.mxchange.jfinancials.exceptions.receipt.ReceiptNotFoundException;
import org.mxchange.jfinancials.model.receipt.BillableReceipt;
/**
*/
public interface FinancialsReceiptWebRequestController extends Serializable {
+ /**
+ * Returns a receipt instance (entity) for given primary key. If not found,
+ * a proper exception is thrown.
+ * <p>
+ * @param receiptId Receipt id (primary key)
+ * <p>
+ * @return Receipt entity matching to primary key
+ * <p>
+ * @throws ReceiptNotFoundException If a receipt with given primary key
+ * could not be found
+ */
+ BillableReceipt findReceiptById (final Long receiptId) throws ReceiptNotFoundException;
+
/**
* Checks if receipt has already been added to database
* <p>
import org.mxchange.jfinancials.events.receipt_item.added.ObservableReceiptItemAddedEvent;
import org.mxchange.jfinancials.events.receipt_item.added.ReceiptItemAddedEvent;
import org.mxchange.jfinancials.exceptions.receipt_item.ReceiptItemAlreadyAddedException;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
import org.mxchange.jfinancials.model.receipt.item.BillableReceiptItem;
import org.mxchange.jfinancials.model.receipt.item.FinancialReceiptItem;
import org.mxchange.jfinancials.model.receipt_item.FinancialAdminReceiptItemSessionBeanRemote;
+import org.mxchange.jproduct.model.product.Product;
/**
* An administrative backing bean for receipt items
@EJB (lookup = "java:global/jfinancials-ejb/adminFinancialReceiptItem!org.mxchange.jfinancials.model.receipt.item.FinancialAdminReceiptItemSessionBeanRemote")
private FinancialAdminReceiptItemSessionBeanRemote adminReceiptItemBean;
+ /**
+ * Discount on product price (if any) Valid: values 0...1 (1=100% discount)
+ */
+ private Float itemDiscount;
+
+ /**
+ * Item product
+ */
+ private Product itemProduct;
+
+ /**
+ * Quantity of item
+ */
+ private Long itemQuantity;
+
+ /**
+ * Assigned receipt
+ */
+ private BillableReceipt itemReceipt;
+
/**
* General receipt item controller
*/
return "add_receipt_item?faces-redirect=true"; //NOI18N
}
+ /**
+ * Getter for item discount
+ * <p>
+ * @return Item discount
+ */
+ public Float getItemDiscount () {
+ return this.itemDiscount;
+ }
+
+ /**
+ * Setter for item discount
+ * <p>
+ * @param itemDiscount Item discount
+ */
+ public void setItemDiscount (final Float itemDiscount) {
+ this.itemDiscount = itemDiscount;
+ }
+
+ /**
+ * Getter for assigned product
+ * <p>
+ * @return Assigned product
+ */
+ public Product getItemProduct () {
+ return this.itemProduct;
+ }
+
+ /**
+ * Setter for assigned product
+ * <p>
+ * @param itemProduct Assigned product
+ */
+ public void setItemProduct (final Product itemProduct) {
+ this.itemProduct = itemProduct;
+ }
+
+ /**
+ * Getter for item quantity
+ * <p>
+ * @return Item quantity
+ */
+ public Long getItemQuantity () {
+ return this.itemQuantity;
+ }
+
+ /**
+ * Setter for item quantity
+ * <p>
+ * @param itemQuantity Item quantity
+ */
+ public void setItemQuantity (final Long itemQuantity) {
+ this.itemQuantity = itemQuantity;
+ }
+
+ /**
+ * Getter for assigned receipt
+ * <p>
+ * @return Assigned receipt
+ */
+ public BillableReceipt getItemReceipt () {
+ return this.itemReceipt;
+ }
+
+ /**
+ * Setter for assigned receipt
+ * <p>
+ * @param itemReceipt Assigned receipt
+ */
+ public void setItemReceipt (final BillableReceipt itemReceipt) {
+ this.itemReceipt = itemReceipt;
+ }
+
/**
* Clears this bean
*/
private void clear () {
// Clear all fields
+ this.setItemDiscount(null);
+ this.setItemProduct(null);
+ this.setItemQuantity(null);
+ this.setItemReceipt(null);
}
/**
*/
private BillableReceiptItem createReceiptItemInstance () {
// Create new instance with minimum required data
- final BillableReceiptItem receiptItem = new FinancialReceiptItem();
+ final BillableReceiptItem receiptItem = new FinancialReceiptItem(this.getItemProduct(), this.getItemQuantity(), this.getItemReceipt());
// Set optional data
+ receiptItem.setItemProductDiscount(this.getItemDiscount());
// Return prepared instance
return receiptItem;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jproduct.events.product.AddedProductEvent;
import org.mxchange.jproduct.events.product.ProductAddedEvent;
-import org.mxchange.jproduct.exceptions.CannotAddProductException;
-import org.mxchange.jproduct.exceptions.ProductTitleAlreadyUsedException;
+import org.mxchange.jproduct.exceptions.product.ProductAlreadyAddedException;
import org.mxchange.jproduct.model.category.Category;
import org.mxchange.jproduct.model.product.AdminProductSessionBeanRemote;
import org.mxchange.jproduct.model.product.GenericProduct;
// Set all to null
this.clear();
- } catch (final ProductTitleAlreadyUsedException | CannotAddProductException ex) {
+ } catch (final ProductAlreadyAddedException ex) {
// Continue to throw
throw new FaceletException(ex);
}
import javax.inject.Named;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
import org.mxchange.jproduct.events.product.AddedProductEvent;
+import org.mxchange.jproduct.exceptions.product.ProductNotFoundException;
import org.mxchange.jproduct.model.product.Product;
import org.mxchange.jproduct.model.product.ProductSessionBeanRemote;
return this.allProducts;
}
+ @Override
+ public Product findProductById (final Long productId) throws ProductNotFoundException {
+ // Validate parameter
+ if (null == productId) {
+ // Throw NPE
+ throw new NullPointerException("productId is null"); //NOI18N
+ } else if (productId < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException("productId=" + productId + " is invalid"); //NOI18N
+ } else if (!this.productCache.containsKey(productId)) {
+ // Not found
+ throw new ProductNotFoundException(productId);
+ }
+
+ // Get it from cache
+ final Product product = this.productCache.get(productId);
+
+ // Return it
+ return product;
+ }
+
/**
* Initialization of this bean
*/
import java.util.List;
import javax.ejb.Local;
import javax.faces.view.facelets.FaceletException;
+import org.mxchange.jproduct.exceptions.product.ProductNotFoundException;
import org.mxchange.jproduct.model.product.Product;
/**
*/
List<Product> allProducts () throws FaceletException;
+ /**
+ * Returns a product instance (entity) for given primary key. If not found,
+ * a proper exception is thrown.
+ * <p>
+ * @param productId Product id (primary key)
+ * <p>
+ * @return Product entity matching to primary key
+ * <p>
+ * @throws ProductNotFoundException If a product with given primary key
+ * could not be found
+ */
+ Product findProductById (final Long productId) throws ProductNotFoundException;
+
}
--- /dev/null
+/*
+ * Copyright (C) 2016, 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/>.
+ */
+package org.mxchange.jfinancials.converter.financial.receipt;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.financial.model.receipt.FinancialsReceiptWebRequestController;
+import org.mxchange.jfinancials.exceptions.receipt.ReceiptNotFoundException;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
+
+/**
+ * Converter for category id <-> valid category instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("ReceiptConverter")
+public class FinancialsReceiptConverter implements Converter<BillableReceipt> {
+
+ /**
+ * Receipt backing bean
+ */
+ private static FinancialsReceiptWebRequestController RECEIPT_CONTROLLER;
+
+ @Override
+ public BillableReceipt getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Is the instance there?
+ if (RECEIPT_CONTROLLER == null) {
+ try {
+ // Not yet, attempt lookup
+ final Context initial = new InitialContext();
+
+ // Lookup EJB
+ RECEIPT_CONTROLLER = (FinancialsReceiptWebRequestController) initial.lookup("java:module/receiptController!org.mxchange.jfinancials.beans.financial.model.receipt.FinancialsReceiptWebRequestController");
+ } catch (final NamingException ex) {
+ // Throw it again
+ throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
+ }
+ }
+
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Init instance
+ BillableReceipt receipt = null;
+
+ try {
+ // Try to parse the value as long
+ final Long receiptId = Long.valueOf(submittedValue);
+
+ // Try to get user instance from it
+ receipt = RECEIPT_CONTROLLER.findReceiptById(receiptId);
+ } catch (final NumberFormatException ex) {
+ // Throw again
+ throw new ConverterException(ex);
+ } catch (final ReceiptNotFoundException ex) {
+ // Debug message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
+ }
+
+ // Return it
+ return receipt;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final BillableReceipt value) {
+ // Is the object null?
+ if ((null == value) || (String.valueOf(value).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ }
+
+ // Return id number
+ return String.valueOf(value.getReceiptId());
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 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/>.
+ */
+package org.mxchange.jfinancials.converter.generic_product;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.product.FinancialProductWebRequestController;
+import org.mxchange.jproduct.exceptions.product.ProductNotFoundException;
+import org.mxchange.jproduct.model.product.Product;
+
+/**
+ * Converter for product id <-> valid product instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("GenericProductConverter")
+public class FinancialsGenericProductConverter implements Converter<Product> {
+
+ /**
+ * Product backing bean
+ */
+ private static FinancialProductWebRequestController PRODUCT_CONTROLLER;
+
+ @Override
+ public Product getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Is the instance there?
+ if (PRODUCT_CONTROLLER == null) {
+ try {
+ // Not yet, attempt lookup
+ final Context initial = new InitialContext();
+
+ // Lookup EJB
+ PRODUCT_CONTROLLER = (FinancialProductWebRequestController) initial.lookup("java:global/jfinancials-ejb/productController!org.mxchange.jfinancials.beans.product.FinancialProductWebRequestController");
+ } catch (final NamingException ex) {
+ // Throw it again
+ throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
+ }
+ }
+
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Init instance
+ Product product = null;
+
+ try {
+ // Try to parse the value as long
+ final Long productId = Long.valueOf(submittedValue);
+
+ // Try to get user instance from it
+ product = PRODUCT_CONTROLLER.findProductById(productId);
+ } catch (final NumberFormatException ex) {
+ // Throw again
+ throw new ConverterException(ex);
+ } catch (final ProductNotFoundException ex) {
+ // Debug message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
+ }
+
+ // Return it
+ return product;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final Product value) {
+ // Is the object null?
+ if ((null == value) || (String.valueOf(value).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ }
+
+ // Return id number
+ return String.valueOf(value.getProductId());
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 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/>.
+ */
+package org.mxchange.jfinancials.converter.product_category;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.category.FinancialCategoryWebRequestController;
+import org.mxchange.jproduct.exceptions.category.CategoryNotFoundException;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * Converter for category id <-> valid category instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("ProductCategoryConverter")
+public class FinancialsProductCategoryConverter implements Converter<Category> {
+
+ /**
+ * Category backing bean
+ */
+ private static FinancialCategoryWebRequestController CATEGORY_CONTROLLER;
+
+ @Override
+ public Category getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Is the instance there?
+ if (CATEGORY_CONTROLLER == null) {
+ try {
+ // Not yet, attempt lookup
+ final Context initial = new InitialContext();
+
+ // Lookup EJB
+ CATEGORY_CONTROLLER = (FinancialCategoryWebRequestController) initial.lookup("java:module/categoryController!org.mxchange.jfinancials.beans.category.FinancialCategoryWebRequestController");
+ } catch (final NamingException ex) {
+ // Throw it again
+ throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup backing bean", ex.getMessage()), ex);
+ }
+ }
+
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Init instance
+ Category category = null;
+
+ try {
+ // Try to parse the value as long
+ final Long categoryId = Long.valueOf(submittedValue);
+
+ // Try to get user instance from it
+ category = CATEGORY_CONTROLLER.findCategoryById(categoryId);
+ } catch (final NumberFormatException ex) {
+ // Throw again
+ throw new ConverterException(ex);
+ } catch (final CategoryNotFoundException ex) {
+ // Debug message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
+ }
+
+ // Return it
+ return category;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final Category value) {
+ // Is the object null?
+ if ((null == value) || (String.valueOf(value).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ }
+
+ // Return id number
+ return String.valueOf(value.getCategoryId());
+ }
+
+}
LOGIN_FINANCIAL_ENTER_RECEIPT_ISSUE_DATE_TITLE=Geben oder suchen Sie hier das genaue Datum aus, wann die Rechnung/der Kassenbon erstellt wurde. Dadurch kann ein genauer Zeitverlauf generiert werden.
PAGE_TITLE_ADMIN_FINANCIALS_RECEIPT_LIST=Kassenbons auflisten
CONTENT_TITLE_ADMIN_FINANCIALS_RECEIPT_LIST=Listet Kassenbons auf:
-TABLE_SUMMARY_ADMIN_LIST_FINANCIAL_RECEIPTS=Diese Tabelle listet bereits registrierte Kassenbons auf.
+TABLE_SUMMARY_ADMIN_LIST_RECEIPTS=Diese Tabelle listet bereits registrierte Kassenbons auf.
#@TODO Please fix German umlauts!
-ADMIN_EMPTY_LIST_FINANCIAL_RECEIPT=Es befinden sich keine Kassenbons in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
+ADMIN_EMPTY_LIST_RECEIPT=Es befinden sich keine Kassenbons in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
#@TODO Please fix German umlauts!
-ADMIN_ADD_FINANCIAL_RECEIPT_TITLE=Neuen Kassenbon hinzufuegen
+ADMIN_ADD_RECEIPT_TITLE=Neuen Kassenbon hinzufuegen
#@TODO Please fix German umlauts!
-BUTTON_ADMIN_ADD_FINANCIAL_RECEIPT=Kassenbon hinzufuegen
-ADMIN_FINANCIAL_RECEIPT_ISSUE_DATE_REQUIRED=Bitte geben Sie das Ausstellungsdatum des Kassenbons ein.
-ADMIN_MENU_FINANCIAL_RECEIPTS_TITLE=Kassenbons
-ADMIN_LINK_LIST_FINANCIAL_RECEIPTS_TITLE=Listet alle registrierten Kassenbons/Rechnungen auf..
-ADMIN_LINK_LIST_FINANCIAL_RECEIPTS=Kassenbons/Rechnungen auflisten
-ADMIN_LIST_FINANCIAL_RECEIPTS_HEADER=Alle Kassenbons/Rechnungen auflisten
-ADMIN_FINANCIAL_RECEIPT_BASIC_LEGEND=Grunddaten des Kassenbons
-ADMIN_FINANCIAL_RECEIPT_BASIC_LEGEND_TITLE=Geben Sie hier die Grunddaten des neuen Kassenbons einn.
-ENTER_FINANCIAL_RECEIPT_ISSUE_DATE=Ausstellungsdatum des Kassenbons eingeben:
-ENTER_FINANCIAL_RECEIPT_NUMBER=Rechnungsnummer eingeben:
+BUTTON_ADMIN_ADD_RECEIPT=Kassenbon hinzufuegen
+ADMIN_RECEIPT_ISSUE_DATE_REQUIRED=Bitte geben Sie das Ausstellungsdatum des Kassenbons ein.
+ADMIN_MENU_RECEIPTS_TITLE=Kassenbons
+ADMIN_LINK_LIST_RECEIPTS_TITLE=Listet alle registrierten Kassenbons/Rechnungen auf..
+ADMIN_LINK_LIST_RECEIPTS=Kassenbons/Rechnungen auflisten
+ADMIN_LIST_RECEIPTS_HEADER=Alle Kassenbons/Rechnungen auflisten
+ADMIN_RECEIPT_BASIC_LEGEND=Grunddaten des Kassenbons
+ADMIN_RECEIPT_BASIC_LEGEND_TITLE=Geben Sie hier die Grunddaten des neuen Kassenbons einn.
+ENTER_RECEIPT_ISSUE_DATE=Ausstellungsdatum des Kassenbons eingeben:
+ENTER_RECEIPT_NUMBER=Rechnungsnummer eingeben:
ENTERED_RECEIPT_NUMBER_INVALID=Die eingegebene Bonnummer/Rechnungsnummer ist kleiner 1 oder groesser 9999999999.
-ADMIN_SELECT_FINANCIAL_RECEIPT_USER_OWNER=Kassenbon einem Benutzer zuweisen:
-ENTER_FINANCIAL_RECEIPT_REGISTER_NUMBER=Kassennummer eingeben:
-ENTER_FINANCIAL_RECEIPT_BARCODE_NUMBER=Barcode-Nummer eingeben:
-ADMIN_FINANCIAL_RECEIPT_OTHER_LEGEND=Sonstige Daten des Kassenbons eingeben:
-ADMIN_FINANCIAL_RECEIPT_OTHER_LEGEND_TITLE=Geben Sie hier weitere Daten an, die Sie auf dem Kassenbon finden koennen.
+ADMIN_SELECT_RECEIPT_USER_OWNER=Kassenbon einem Benutzer zuweisen:
+ENTER_RECEIPT_REGISTER_NUMBER=Kassennummer eingeben:
+ENTER_RECEIPT_BARCODE_NUMBER=Barcode-Nummer eingeben:
+ADMIN_RECEIPT_OTHER_LEGEND=Sonstige Daten des Kassenbons eingeben:
+ADMIN_RECEIPT_OTHER_LEGEND_TITLE=Geben Sie hier weitere Daten an, die Sie auf dem Kassenbon finden koennen.
ADMIN_LINK_SHOW_RECEIPT_OWNER_USER_TITLE=Zeigt zugewiesenen Benutzer des Kassenbons an.
#@TODO Please fix German umlauts!
ADMIN_ASSIGNED_RECEIPT_SELLER=Zugewiesener Verkaeufer:
DEPARTMENT_NAME_SALES=Verkauf
#@TODO Please fix German umlauts!
-ADMIN_LINK_LIST_FINANCIAL_RECEIPT_ITEMS=Eintraege auflisten
+ADMIN_LINK_LIST_RECEIPT_ITEMS=Eintraege auflisten
#@TODO Please fix German umlauts!
-ADMIN_LINK_LIST_FINANCIAL_RECEIPT_ITEMS_TITLE=Listet alle Eintraege aller Kassenbons auf.
+ADMIN_LINK_LIST_RECEIPT_ITEMS_TITLE=Listet alle Eintraege aller Kassenbons auf.
ADMIN_LINK_SHOW_RECEIPT_TITLE=Zeigt Daten des Kassenbons an.
ADMIN_LINK_SHOW_RECEIPT_ITEM_TITLE=Zeigt Daten eines Eintrages eines Kassenbons an.
LOGIN_FINANCIAL_ENTER_RECEIPT_ISSUE_DATE_TITLE=Please enter or select here the exact date when the receipt has been issue. Then an exact time-line can be generated.
PAGE_TITLE_ADMIN_FINANCIALS_RECEIPT_LIST=List receipts
CONTENT_TITLE_ADMIN_FINANCIALS_RECEIPT_LIST=Lists receipts:
-TABLE_SUMMARY_ADMIN_LIST_FINANCIAL_RECEIPTS=This table lists already registered receipts.
-ADMIN_EMPTY_LIST_FINANCIAL_RECEIPT=There are no receipts in database. Or your search criteria doesn't match anything.
-ADMIN_ADD_FINANCIAL_RECEIPT_TITLE=Add new receipt
-BUTTON_ADMIN_ADD_FINANCIAL_RECEIPT=Add receipt
-ADMIN_FINANCIAL_RECEIPT_ISSUE_DATE_REQUIRED=Please enter date of issue of receipt.
-ADMIN_MENU_FINANCIAL_RECEIPTS_TITLE=Receipts
-ADMIN_LINK_LIST_FINANCIAL_RECEIPTS_TITLE=Lists all registered receipts.
-ADMIN_LINK_LIST_FINANCIAL_RECEIPTS=List receipts
-ADMIN_LIST_FINANCIAL_RECEIPTS_HEADER=List all receipts
-ADMIN_FINANCIAL_RECEIPT_BASIC_LEGEND=Basic data of receipt:
-ADMIN_FINANCIAL_RECEIPT_BASIC_LEGEND_TITLE=Enter here basic data of the new receipt.
-ENTER_FINANCIAL_RECEIPT_ISSUE_DATE=Enter date of issue of receipt:
-ENTER_FINANCIAL_RECEIPT_NUMBER=Enter receipt number:
+TABLE_SUMMARY_ADMIN_LIST_RECEIPTS=This table lists already registered receipts.
+ADMIN_EMPTY_LIST_RECEIPT=There are no receipts in database. Or your search criteria doesn't match anything.
+ADMIN_ADD_RECEIPT_TITLE=Add new receipt
+BUTTON_ADMIN_ADD_RECEIPT=Add receipt
+ADMIN_RECEIPT_ISSUE_DATE_REQUIRED=Please enter date of issue of receipt.
+ADMIN_MENU_RECEIPTS_TITLE=Receipts
+ADMIN_LINK_LIST_RECEIPTS_TITLE=Lists all registered receipts.
+ADMIN_LINK_LIST_RECEIPTS=List receipts
+ADMIN_LIST_RECEIPTS_HEADER=List all receipts
+ADMIN_RECEIPT_BASIC_LEGEND=Basic data of receipt:
+ADMIN_RECEIPT_BASIC_LEGEND_TITLE=Enter here basic data of the new receipt.
+ENTER_RECEIPT_ISSUE_DATE=Enter date of issue of receipt:
+ENTER_RECEIPT_NUMBER=Enter receipt number:
ENTERED_RECEIPT_NUMBER_INVALID=Your entered receipt number is smaller than 1 or larger than 9999999999.
-ADMIN_SELECT_FINANCIAL_RECEIPT_USER_OWNER=Assign receipt to user:
-ENTER_FINANCIAL_RECEIPT_REGISTER_NUMBER=Enter cash register number:
-ENTER_FINANCIAL_RECEIPT_BARCODE_NUMBER=Enter bar code number:
-ADMIN_FINANCIAL_RECEIPT_OTHER_LEGEND=Enter other data of receipt:
-ADMIN_FINANCIAL_RECEIPT_OTHER_LEGEND_TITLE=Enter other additional data you can find on the receipt.
+ADMIN_SELECT_RECEIPT_USER_OWNER=Assign receipt to user:
+ENTER_RECEIPT_REGISTER_NUMBER=Enter cash register number:
+ENTER_RECEIPT_BARCODE_NUMBER=Enter bar code number:
+ADMIN_RECEIPT_OTHER_LEGEND=Enter other data of receipt:
+ADMIN_RECEIPT_OTHER_LEGEND_TITLE=Enter other additional data you can find on the receipt.
ADMIN_LINK_SHOW_RECEIPT_OWNER_USER_TITLE=Shows assigned user of receipt.
ADMIN_ASSIGNED_RECEIPT_SELLER=Assigned seller:
DEPARTMENT_NAME_SALES=Sales
-ADMIN_LINK_LIST_FINANCIAL_RECEIPT_ITEMS=List receipt items
-ADMIN_LINK_LIST_FINANCIAL_RECEIPT_ITEMS_TITLE=Lists all receipt items.
+ADMIN_LINK_LIST_RECEIPT_ITEMS=List receipt items
+ADMIN_LINK_LIST_RECEIPT_ITEMS_TITLE=Lists all receipt items.
ADMIN_LINK_SHOW_RECEIPT_TITLE=Shows receipt data.
ADMIN_LINK_SHOW_RECEIPT_ITEM_TITLE=Shows receipt item data.
<ul class="navbar-mini">
<ui:fragment rendered="#{empty renderShowLink or renderShowLink}">
<li class="navlink-mini">
- <p:link outcome="admin_show_receipt" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_FINANCIAL_RECEIPT_TITLE}">
+ <p:link outcome="admin_show_receipt" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{project.ADMIN_LINK_SHOW_RECEIPT_TITLE}">
<f:param name="receiptId" value="#{receipt.receiptId}" />
</p:link>
</li>
</ui:fragment>
<li class="navlink-mini">
- <p:link outcome="admin_edit_receipt" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_FINANCIAL_RECEIPT_TITLE}">
+ <p:link outcome="admin_edit_receipt" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{project.ADMIN_LINK_EDIT_RECEIPT_TITLE}">
<f:param name="receiptId" value="#{receipt.receiptId}" />
</p:link>
</li>
<li class="navlink-mini">
<p:link outcome="admin_delete_receipt">
- <h:outputText styleClass="link-danger" value="#{msg.ADMIN_LINK_DELETE_SHORT}" title="#{msg.ADMIN_LINK_DELETE_FINANCIAL_RECEIPT_TITLE}" />
+ <h:outputText styleClass="link-danger" value="#{msg.ADMIN_LINK_DELETE_SHORT}" title="#{project.ADMIN_LINK_DELETE_RECEIPT_TITLE}" />
<f:param name="receiptId" value="#{receipt.receiptId}" />
</p:link>
</li>
--- /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:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:p="http://primefaces.org/ui">
+
+ <ui:fragment rendered="#{empty rendered or rendered}">
+ <ul class="navbar-mini">
+ <ui:fragment rendered="#{empty renderShowLink or renderShowLink}">
+ <li class="navlink-mini">
+ <p:link outcome="admin_show_receipt" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{project.ADMIN_LINK_SHOW_RECEIPT_ITEM_TITLE}">
+ <f:param name="receiptId" value="#{receiptItem.itemId}" />
+ </p:link>
+ </li>
+ </ui:fragment>
+
+ <li class="navlink-mini">
+ <p:link outcome="admin_edit_receipt" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{project.ADMIN_LINK_EDIT_RECEIPT_ITEM_TITLE}">
+ <f:param name="receiptId" value="#{receiptItem.itemId}" />
+ </p:link>
+ </li>
+
+ <li class="navlink-mini">
+ <p:link outcome="admin_delete_receipt">
+ <h:outputText styleClass="link-danger" value="#{msg.ADMIN_LINK_DELETE_SHORT}" title="#{project.ADMIN_LINK_DELETE_RECEIPT_ITEM_TITLE}" />
+ <f:param name="receiptId" value="#{receiptItem.itemId}" />
+ </p:link>
+ </li>
+ </ul>
+ </ui:fragment>
+</ui:composition>
xmlns:p="http://primefaces.org/ui">
<!--
- @TODO: title="#{project.ADMIN_FINANCIAL_RECEIPT_BASIC_LEGEND_TITLE}"
+ @TODO: title="#{project.ADMIN_RECEIPT_BASIC_LEGEND_TITLE}"
-->
- <p:fieldset legend="#{project.ADMIN_FINANCIAL_RECEIPT_BASIC_LEGEND}">
+ <p:fieldset legend="#{project.ADMIN_RECEIPT_BASIC_LEGEND}">
<p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
<p:outputLabel for="branchOffice" value="#{msg.ADMIN_SELECT_BRANCH_OFFICE}" />
<p:selectOneMenu
filter="true"
filterMatchMode="contains"
required="true"
- requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_COMPANY_REQUIRED}"
+ requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_REQUIRED}"
>
<f:converter converterId="BranchOfficeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
<f:selectItems value="#{branchOfficeController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{branchOffice.branchCompany.companyName} #{branchOffice.branchStreet} #{branchOffice.branchHouseNumber}, #{branchOffice.branchCity}" />
</p:selectOneMenu>
- <p:outputLabel for="receiptIssued" value="#{project.ENTER_FINANCIAL_RECEIPT_ISSUE_DATE}" />
+ <p:outputLabel for="receiptIssued" value="#{project.ENTER_RECEIPT_ISSUE_DATE}" />
<p:calendar
id="receiptIssued"
value="#{adminReceiptController.receiptIssued}"
required="true"
- requiredMessage="#{project.ADMIN_FINANCIAL_RECEIPT_ISSUE_DATE_REQUIRED}"
+ requiredMessage="#{project.ADMIN_RECEIPT_ISSUE_DATE_REQUIRED}"
pattern="#{msg.DATE_PATTERN}"
navigator="true"
maskAutoClear="true"
filter="true"
filterMatchMode="contains"
>
- <f:converter converterId="CompanyEmployeeConverter" />
+ <f:converter converterId="EmployeeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="companyEmployee" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.employeeNumber} #{beanHelper.renderContact(companyEmployee.employeePersonalData)}" itemDescription="#{companyEmployee.employeeCompany.companyName}, #{beanHelper.renderBranchOffice(companyEmployee.employeeBranchOffice)}" />
+ <f:selectItems value="#{employeeController.allEmployees()}" var="companyEmployee" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.employeeNumber} #{beanHelper.renderContact(companyEmployee.employeePersonalData)}" itemDescription="#{companyEmployee.employeeCompany.companyName}, #{beanHelper.renderBranchOffice(companyEmployee.employeeBranchOffice)}" />
</p:selectOneMenu>
- <p:outputLabel for="receiptUser" value="#{project.ADMIN_SELECT_FINANCIAL_RECEIPT_USER_OWNER}" />
+ <p:outputLabel for="receiptUser" value="#{project.ADMIN_SELECT_RECEIPT_USER_OWNER}" />
<p:selectOneMenu
id="receiptUser"
value="#{adminReceiptController.receiptUser}"
</p:panelGrid>
</p:fieldset>
- <p:fieldset legend="#{project.ADMIN_FINANCIAL_RECEIPT_OTHER_LEGEND}">
+ <p:fieldset legend="#{project.ADMIN_RECEIPT_OTHER_LEGEND}">
<!--
- @TODO: title="#{project.ADMIN_FINANCIAL_RECEIPT_OTHER_LEGEND_TITLE}">
+ @TODO: title="#{project.ADMIN_RECEIPT_OTHER_LEGEND_TITLE}">
-->
<p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
- <p:outputLabel for="receiptNumber" value="#{project.ENTER_FINANCIAL_RECEIPT_NUMBER}" />
+ <p:outputLabel for="receiptNumber" value="#{project.ENTER_RECEIPT_NUMBER}" />
<p:inputText styleClass="input" id="receiptNumber" size="10" maxlength="20" value="#{adminReceiptController.receiptNumber}" validatorMessage="#{msg.ENTERED_RECEIPT_NUMBER_INVALID}">
<f:validateLongRange minimum="1" maximum="9999999999" />
</p:inputText>
- <p:outputLabel for="receiptRegisterNumber" value="#{project.ENTER_FINANCIAL_RECEIPT_REGISTER_NUMBER}" />
+ <p:outputLabel for="receiptRegisterNumber" value="#{project.ENTER_RECEIPT_REGISTER_NUMBER}" />
<p:inputText styleClass="input" id="receiptRegisterNumber" size="3" maxlength="10" value="#{adminReceiptController.receiptRegisterNumber}" validatorMessage="#{msg.ENTERED_RECEIPT_REGISTER_NUMBER_INVALID}">
<f:validateLongRange minimum="1" maximum="999" />
</p:inputText>
- <p:outputLabel for="receiptBarCodeNumber" value="#{project.ENTER_FINANCIAL_RECEIPT_BARCODE_NUMBER}" />
+ <p:outputLabel for="receiptBarCodeNumber" value="#{project.ENTER_RECEIPT_BARCODE_NUMBER}" />
<p:inputText styleClass="input" id="receiptBarCodeNumber" size="24" maxlength="24" value="#{adminReceiptController.receiptBarCodeNumber}" />
</p:panelGrid>
</p:fieldset>
xmlns:p="http://primefaces.org/ui">
<!--
- @TODO: title="#{project.ADMIN_FINANCIAL_RECEIPT_ITEM_BASIC_LEGEND_TITLE}"
+ @TODO: title="#{project.ADMIN_RECEIPT_ITEM_BASIC_LEGEND_TITLE}"
-->
- <p:fieldset legend="#{project.ADMIN_FINANCIAL_RECEIPT_ITEM_BASIC_LEGEND}">
+ <p:fieldset legend="#{project.ADMIN_RECEIPT_ITEM_BASIC_LEGEND}">
<p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
- <p:outputLabel for="itemProduct" value="#{msg.ADMIN_SELECT_BRANCH_OFFICE}" />
+ <p:outputLabel for="itemProduct" value="#{project.ADMIN_SELECT_PRODUCT}" />
<p:selectOneMenu
id="itemProduct"
- value="#{adminReceiptItemController.receiptBranchOffice}"
+ value="#{adminReceiptItemController.itemProduct}"
filter="true"
filterMatchMode="contains"
required="true"
- requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_COMPANY_REQUIRED}"
+ requiredMessage="#{project.ADMIN_PRODUCT_REQUIRED}"
>
- <f:converter converterId="ProductConverter" />
+ <f:converter converterId="GenericProductConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
- <f:selectItems value="#{productController.allProducts()}" var="product" itemValue="#{product}" itemLabel="#{product}" />
+ <f:selectItems value="#{productController.allProducts()}" var="product" itemValue="#{product}" itemLabel="#{beanHelper.renderProduct(product)}" />
</p:selectOneMenu>
- <p:outputLabel for="receiptIssued" value="#{project.ENTER_FINANCIAL_RECEIPT_ITEM_ISSUE_DATE}" />
- <p:calendar
- id="receiptIssued"
- value="#{adminReceiptItemController.receiptIssued}"
+ <p:outputLabel for="itemQuantity" value="#{project.ENTER_RECEIPT_ITEM_QUANTITY}" />
+ <p:inputNumber
+ id="itemQuantity"
+ value="#{adminReceiptItemController.itemQuantity}"
required="true"
- requiredMessage="#{project.ADMIN_FINANCIAL_RECEIPT_ITEM_ISSUE_DATE_REQUIRED}"
- pattern="#{msg.DATE_PATTERN}"
- navigator="true"
- maskAutoClear="true"
- styleClass="input"
- title="#{project.ADMIN_RECEIPT_ITEM_DATE_OF_ISSUE_TITLE}"
+ requiredMessage="#{project.ADMIN_RECEIPT_QUANTITY_REQUIRED}"
+ title="#{project.ADMIN_RECEIPT_ITEM_QUANTITY_TITLE}"
/>
- <p:outputLabel for="receiptPaymentType" value="#{msg.ADMIN_SELECT_PAYMENT_TYPE}" />
- <p:selectOneMenu
- id="receiptPaymentType"
- value="#{adminReceiptItemController.receiptPaymentType}"
- filter="true"
- filterMatchMode="contains"
- required="true"
- requiredMessage="#{project.FIELD_PAYMENT_TYPE_REQUIRED}"
- >
- <f:converter converterId="PaymentTypeConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
- <f:selectItems value="#{dataController.paymentTypes}" var="receiptPaymentType" itemValue="#{paymentType}" itemLabel="#{msg[paymentType.i18nKey]}" />
- </p:selectOneMenu>
-
- <p:outputLabel for="receiptSellerEmployee" value="#{msg.ADMIN_SELECT_SELLER_EMPLOYEE}" />
- <p:selectOneMenu
- id="receiptSellerEmployee"
- value="#{adminReceiptItemController.receiptSellerEmployee}"
- filter="true"
- filterMatchMode="contains"
- >
- <f:converter converterId="CompanyEmployeeConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="companyEmployee" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.employeeNumber} #{beanHelper.renderContact(companyEmployee.employeePersonalData)}" itemDescription="#{companyEmployee.employeeCompany.companyName}, #{beanHelper.renderBranchOffice(companyEmployee.employeeBranchOffice)}" />
- </p:selectOneMenu>
+ <p:outputLabel for="itemDiscount" value="#{project.ENTER_RECEIPT_ITEM_DISCOUNT}" />
+ <p:inputNumber
+ id="itemDiscount"
+ value="#{adminReceiptItemController.itemDiscount}"
+ title="#{project.ADMIN_RECEIPT_ITEM_DISCOUNT_TITLE}"
+ />
- <p:outputLabel for="receiptUser" value="#{project.ADMIN_SELECT_FINANCIAL_RECEIPT_ITEM_USER_OWNER}" />
+ <p:outputLabel for="itemReceipt" value="#{project.ADMIN_SELECT_ITEM_RECEIPT}" />
<p:selectOneMenu
- id="receiptUser"
- value="#{adminReceiptItemController.receiptUser}"
+ id="itemReceipt"
+ value="#{adminReceiptItemController.itemReceipt}"
filter="true"
filterMatchMode="contains"
>
- <f:converter converterId="UserConverter" />
+ <f:converter converterId="ReceiptConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{userController.allUsers()}" var="receiptUser" itemValue="#{receiptUser}" itemLabel="#{receiptUser.userContact.contactFirstName} #{receiptUser.userContact.contactFamilyName} (#{receiptUser.userName})" />
+ <f:selectItems value="#{receiptController.allReceipts()}" var="receipt" itemValue="#{receipt}" itemLabel="#{beanHelper.renderReceipt(receipt)}" />
</p:selectOneMenu>
</p:panelGrid>
</p:fieldset>
- <p:fieldset legend="#{project.ADMIN_FINANCIAL_RECEIPT_ITEM_OTHER_LEGEND}">
+ <p:fieldset legend="#{project.ADMIN_RECEIPT_ITEM_OTHER_LEGEND}">
<!--
- @TODO: title="#{project.ADMIN_FINANCIAL_RECEIPT_ITEM_OTHER_LEGEND_TITLE}">
+ @TODO: title="#{project.ADMIN_RECEIPT_ITEM_OTHER_LEGEND_TITLE}">
-->
<p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
- <p:outputLabel for="receiptNumber" value="#{project.ENTER_FINANCIAL_RECEIPT_ITEM_NUMBER}" />
+ <p:outputLabel for="receiptNumber" value="#{project.ENTER_RECEIPT_ITEM_NUMBER}" />
<p:inputText styleClass="input" id="receiptNumber" size="10" maxlength="20" value="#{adminReceiptItemController.receiptNumber}" validatorMessage="#{msg.ENTERED_RECEIPT_ITEM_NUMBER_INVALID}">
<f:validateLongRange minimum="1" maximum="9999999999" />
</p:inputText>
- <p:outputLabel for="receiptRegisterNumber" value="#{project.ENTER_FINANCIAL_RECEIPT_ITEM_REGISTER_NUMBER}" />
+ <p:outputLabel for="receiptRegisterNumber" value="#{project.ENTER_RECEIPT_ITEM_REGISTER_NUMBER}" />
<p:inputText styleClass="input" id="receiptRegisterNumber" size="3" maxlength="10" value="#{adminReceiptItemController.receiptRegisterNumber}" validatorMessage="#{msg.ENTERED_RECEIPT_ITEM_REGISTER_NUMBER_INVALID}">
<f:validateLongRange minimum="1" maximum="999" />
</p:inputText>
- <p:outputLabel for="receiptBarCodeNumber" value="#{project.ENTER_FINANCIAL_RECEIPT_ITEM_BARCODE_NUMBER}" />
+ <p:outputLabel for="receiptBarCodeNumber" value="#{project.ENTER_RECEIPT_ITEM_BARCODE_NUMBER}" />
<p:inputText styleClass="input" id="receiptBarCodeNumber" size="24" maxlength="24" value="#{adminReceiptItemController.receiptBarCodeNumber}" />
</p:panelGrid>
</p:fieldset>
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
- <p:submenu label="#{project.ADMIN_MENU_FINANCIAL_RECEIPTS_TITLE}">
- <p:menuitem title="#{project.ADMIN_LINK_LIST_FINANCIAL_RECEIPTS_TITLE}" outcome="admin_list_receipts" value="#{project.ADMIN_LINK_LIST_FINANCIAL_RECEIPTS}" />
- <p:menuitem title="#{project.ADMIN_LINK_LIST_FINANCIAL_RECEIPT_ITEMS_TITLE}" outcome="admin_list_receipt_items" value="#{project.ADMIN_LINK_LIST_FINANCIAL_RECEIPT_ITEMS}" />
+ <p:submenu label="#{project.ADMIN_MENU_RECEIPTS_TITLE}">
+ <p:menuitem title="#{project.ADMIN_LINK_LIST_RECEIPTS_TITLE}" outcome="admin_list_receipts" value="#{project.ADMIN_LINK_LIST_RECEIPTS}" />
+ <p:menuitem title="#{project.ADMIN_LINK_LIST_RECEIPT_ITEMS_TITLE}" outcome="admin_list_receipt_items" value="#{project.ADMIN_LINK_LIST_RECEIPT_ITEMS}" />
</p:submenu>
</ui:composition>
xmlns:p="http://primefaces.org/ui">
<fieldset class="fieldset">
- <legend title="#{project.LOGIN_FINANCIAL_RECEIPT_BASIC_LEGEND_TITLE}">
- <h:outputText value="#{project.LOGIN_FINANCIAL_RECEIPT_BASIC_LEGEND}" />
+ <legend title="#{project.LOGIN_RECEIPT_BASIC_LEGEND_TITLE}">
+ <h:outputText value="#{project.LOGIN_RECEIPT_BASIC_LEGEND}" />
</legend>
<p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full">
filter="true"
filterMatchMode="contains"
required="true"
- requiredMessage="#{msg.LOGIN_BRANCH_OFFICE_COMPANY_REQUIRED}"
+ requiredMessage="#{msg.LOGIN_BRANCH_OFFICE_REQUIRED}"
>
<f:converter converterId="BranchOfficeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
</p:selectOneMenu>
<p:message for="branchOffice" />
- <p:outputLabel for="receiptIssued" value="#{project.ENTER_FINANCIAL_RECEIPT_ISSUE_DATE}" />
+ <p:outputLabel for="receiptIssued" value="#{project.ENTER_RECEIPT_ISSUE_DATE}" />
<p:calendar
id="receiptIssued"
value="#{receiptController.receiptIssued}"
required="true"
- requiredMessage="#{project.LOGIN_FINANCIAL_RECEIPT_ISSUE_DATE_REQUIRED}"
+ requiredMessage="#{project.LOGIN_RECEIPT_ISSUE_DATE_REQUIRED}"
pattern="#{msg.DATE_PATTERN}"
navigator="true"
maskAutoClear="true"
filter="true"
filterMatchMode="contains"
>
- <f:converter converterId="CompanyEmployeeConverter" />
+ <f:converter converterId="EmployeeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
+ <f:selectItems value="#{employeeController.allEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
</p:selectOneMenu>
<p:message for="receiptSellerEmployee" />
</p:panelGrid>
</fieldset>
<fieldset class="fieldset">
- <legend title="#{project.LOGIN_FINANCIAL_RECEIPT_OTHER_LEGEND_TITLE}">
- <h:outputText value="#{project.LOGIN_FINANCIAL_RECEIPT_OTHER_LEGEND}" />
+ <legend title="#{project.LOGIN_RECEIPT_OTHER_LEGEND_TITLE}">
+ <h:outputText value="#{project.LOGIN_RECEIPT_OTHER_LEGEND}" />
</legend>
<p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full">
- <p:outputLabel for="receiptNumber" value="#{project.FINANCIAL_RECEIPT_NUMBER}" />
+ <p:outputLabel for="receiptNumber" value="#{project.RECEIPT_NUMBER}" />
<p:inputText styleClass="input" id="receiptNumber" size="10" maxlength="20" value="#{receiptController.receiptNumber}" validatorMessage="#{msg.ENTERED_RECEIPT_NUMBER_INVALID}">
<f:validateLongRange minimum="1" maximum="9999999999" />
</p:inputText>
<p:message for="receiptNumber" />
- <p:outputLabel for="receiptRegisterNumber" value="#{project.FINANCIAL_RECEIPT_REGISTER_NUMBER}" />
+ <p:outputLabel for="receiptRegisterNumber" value="#{project.RECEIPT_REGISTER_NUMBER}" />
<p:inputText styleClass="input" id="receiptRegisterNumber" size="3" maxlength="10" value="#{receiptController.receiptRegisterNumber}" validatorMessage="#{msg.ENTERED_RECEIPT_REGISTER_NUMBER_INVALID}">
<f:validateLongRange minimum="1" maximum="999" />
</p:inputText>
<p:message for="receiptRegisterNumber" />
- <p:outputLabel for="receiptBarCodeNumber" value="#{project.FINANCIAL_RECEIPT_BARCODE_NUMBER}" />
+ <p:outputLabel for="receiptBarCodeNumber" value="#{project.RECEIPT_BARCODE_NUMBER}" />
<p:inputText styleClass="input" id="receiptBarCodeNumber" size="24" maxlength="24" value="#{receiptController.receiptBarCodeNumber}" />
<p:message for="receiptBarCodeNumber" />
</p:panelGrid>
resizableColumns="true"
rowsPerPageTemplate="5,10,20,50,100"
sortMode="multiple"
- summary="#{project.TABLE_SUMMARY_ADMIN_LIST_FINANCIAL_RECEIPT_ITEMSS}"
- emptyMessage="#{project.ADMIN_EMPTY_LIST_FINANCIAL_RECEIPT_ITEM}"
+ summary="#{project.TABLE_SUMMARY_ADMIN_LIST_RECEIPT_ITEMSS}"
+ emptyMessage="#{project.ADMIN_EMPTY_LIST_RECEIPT_ITEM}"
widgetVar="receiptItemList"
>
<f:facet name="header">
<p:panelGrid columns="2" columnClasses="ui-grid-col-10, ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
- <h:outputText value="#{project.ADMIN_LIST_FINANCIAL_RECEIPT_ITEMS_HEADER}" />
+ <h:outputText value="#{project.ADMIN_LIST_RECEIPT_ITEMS_HEADER}" />
<h:panelGroup>
<p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
updateLabel="true"
title="#{project.FILTER_BY_MULTIPLE_RECEIPT_SELLERS_TITLE}"
>
- <f:converter converterId="CompanyEmployeeConverter" />
+ <f:converter converterId="EmployeeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+ <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
</p:selectCheckboxMenu>
</f:facet>
<p:panelGrid layout="grid" columns="1" styleClass="table table-full">
<h:panelGroup styleClass="table-header" layout="block">
<h4>
- <h:outputText value="#{project.ADMIN_ADD_FINANCIAL_RECEIPT_ITEM_TITLE}" />
+ <h:outputText value="#{project.ADMIN_ADD_RECEIPT_ITEM_TITLE}" />
</h4>
</h:panelGroup>
<p:commandButton
styleClass="submit"
type="submit"
- value="#{project.BUTTON_ADMIN_ADD_FINANCIAL_RECEIPT_TEM}"
+ value="#{project.BUTTON_ADMIN_ADD_RECEIPT_TEM}"
action="#{adminReceiptItemController.addReceiptItem()}"
update=":master:form-list-financial-receipt-item:table-list-financial-receipt-item"
/>
resizableColumns="true"
rowsPerPageTemplate="5,10,20,50,100"
sortMode="multiple"
- summary="#{project.TABLE_SUMMARY_ADMIN_LIST_FINANCIAL_RECEIPTS}"
- emptyMessage="#{project.ADMIN_EMPTY_LIST_FINANCIAL_RECEIPT}"
+ summary="#{project.TABLE_SUMMARY_ADMIN_LIST_RECEIPTS}"
+ emptyMessage="#{project.ADMIN_EMPTY_LIST_RECEIPT}"
widgetVar="receiptList"
>
<f:facet name="header">
<p:panelGrid columns="2" columnClasses="ui-grid-col-10, ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
- <h:outputText value="#{project.ADMIN_LIST_FINANCIAL_RECEIPTS_HEADER}" />
+ <h:outputText value="#{project.ADMIN_LIST_RECEIPTS_HEADER}" />
<h:panelGroup>
<p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
updateLabel="true"
title="#{project.FILTER_BY_MULTIPLE_RECEIPT_SELLERS_TITLE}"
>
- <f:converter converterId="CompanyEmployeeConverter" />
+ <f:converter converterId="EmployeeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{employeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
+ <f:selectItems value="#{employeeController.allEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{beanHelper.renderEmployee(employee)}" />
</p:selectCheckboxMenu>
</f:facet>
<p:panelGrid layout="grid" columns="1" styleClass="table table-full">
<h:panelGroup styleClass="table-header" layout="block">
<h4>
- <h:outputText value="#{project.ADMIN_ADD_FINANCIAL_RECEIPT_TITLE}" />
+ <h:outputText value="#{project.ADMIN_ADD_RECEIPT_TITLE}" />
</h4>
</h:panelGroup>
<p:commandButton
styleClass="submit"
type="submit"
- value="#{project.BUTTON_ADMIN_ADD_FINANCIAL_RECEIPT}"
+ value="#{project.BUTTON_ADMIN_ADD_RECEIPT}"
action="#{adminReceiptController.addReceipt()}"
update=":master:form-list-financial-receipt:table-list-financial-receipt"
/>
<h:form id="form_add_financial_receipt">
<p:panelGrid layout="grid" columns="1" headerClass="table-header" footerClass="table-footer" styleClass="table table-full">
<f:facet name="header">
- <h:outputText value="#{project.LOGIN_ADD_FINANCIAL_RECEIPT_TITLE}" />
+ <h:outputText value="#{project.LOGIN_ADD_RECEIPT_TITLE}" />
</f:facet>
<p:column>
<f:facet name="footer">
<p:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <p:commandButton styleClass="submit" type="submit" id="submit_add_financial_receipt" value="#{project.BUTTON_LOGIN_ADD_FINANCIAL_RECEIPT}" action="#{receiptController.addReceipt()}" />
+ <p:commandButton styleClass="submit" type="submit" id="submit_add_financial_receipt" value="#{project.BUTTON_LOGIN_ADD_RECEIPT}" action="#{receiptController.addReceipt()}" />
</f:facet>
</p:panelGrid>
</h:form>