From f23667bfe980bdac13bd651333f5de24fa5a5690 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org> Date: Tue, 15 May 2018 01:03:34 +0200 Subject: [PATCH] Don't cherry-pick: - added helper bean for fiancial beans, renderReceipt() was moved here - need to have > of <ui:composition> in own line to avoid editing 2 lines when adding an another XML namespace - wrapped all (?) long JSF/PF tags to have their attributes in separates lines - using no longer tableStyleClass attribute - continued with single receipt item p:dialog (all fields exposed there) - position of it set to "top" - oh, no more columnClasses="label,value" ... ;-) - also no more styleClass="submit|reset" (themed) - added process="@form" as a workaround for an exception (BalusC said this) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder <roland@mxchange.org> --- .../FinancialsWebViewReceiptHelperBean.java | 83 +++++++++++++ ...ancialsWebViewReceiptHelperController.java | 28 +++++ .../localization/project_de_DE.properties | 57 ++++++--- .../localization/project_en_US.properties | 50 ++++++-- web/WEB-INF/project-links.jsf.taglib.xml | 10 +- .../financial/receipt/admin_receipt_links.tpl | 3 +- .../receipt_item/admin_receipt_item_links.tpl | 3 +- .../receipt/admin_form_financial_receipt.tpl | 19 ++- .../admin_form_financial_receipt_item.tpl | 24 ++-- .../receipt/login_form_financial_receipt.tpl | 29 +++-- .../receipt/admin_receipt_list.xhtml | 64 ++++++---- .../admin_receipt_item_list.xhtml | 112 +++++++++++++++--- .../login_financials_add_income.xhtml | 32 +++-- .../login_financials_add_receipt.xhtml | 32 +++-- .../login_financials_overview.xhtml | 26 ++-- 15 files changed, 447 insertions(+), 125 deletions(-) create mode 100644 src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperBean.java create mode 100644 src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperController.java diff --git a/src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperBean.java b/src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperBean.java new file mode 100644 index 00000000..acca0d62 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperBean.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2016 - 2018 Free Software Foundation + * + * 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.beans.helper.receipt; + +import java.text.DateFormat; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.mxchange.jfinancials.beans.BaseFinancialsBean; +import org.mxchange.jfinancials.model.receipt.BillableReceipt; + +/** + * A receipt helper for beans + * <p> + * @author Roland Häder<roland@mxchange.org> + */ +@Named ("receiptBeanHelper") +@ViewScoped +public class FinancialsWebViewReceiptHelperBean extends BaseFinancialsBean implements FinancialsWebViewReceiptHelperController { + + /** + * Serial number + */ + private static final long serialVersionUID = 17_258_793_567_145_811L; + + /** + * Default constructor + */ + public FinancialsWebViewReceiptHelperBean () { + // Call super constructor + super(); + } + + /** + * Returns the receipt number and more. If null is provided, an empty string is returned. + * <p> + * @param receipt Receipt instance + * <p> + * @return Receipt number and more + */ + public String renderReceipt (final BillableReceipt receipt) { + // Default is empty string, so let's get started + final StringBuilder sb = new StringBuilder(50); + + // Is receipt set? + if (receipt instanceof BillableReceipt) { + // Add relevant data + sb.append(this.getMessageFromBundle("RECEIPT_ISSUED")).append(" "); //NOI18N + sb.append(DateFormat.getInstance().format(receipt.getReceiptIssued())).append(", "); //NOI18N + sb.append(this.getMessageFromBundle("PAYMENT_TYPE")).append(" "); //NOI18N + sb.append(this.getMessageFromBundle(receipt.getReceiptPaymentType().getI18nKey())); + + // Is receipt number included? + if (receipt.getReceiptNumber() != null) { + // Append it + sb.append(", ").append(this.getMessageFromBundle("RECEIPT_NUMBER")).append(" "); //NOI18N + sb.append(receipt.getReceiptNumber()); + } + + // Add company (over branch office) + sb.append(" ("); //NOI18N + sb.append(receipt.getReceiptBranchOffice().getBranchCompany().getCompanyName()); + sb.append(")"); //NOI18N + } + + // Return it + return sb.toString(); + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperController.java b/src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperController.java new file mode 100644 index 00000000..7bdf9f1f --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/helper/receipt/FinancialsWebViewReceiptHelperController.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2016 - 2018 Free Software Foundation + * + * 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.beans.helper.receipt; + +import java.io.Serializable; + +/** + * An interface for receipt bean helper + * <p> + * @author Roland Häder<roland@mxchange.org> + */ +public interface FinancialsWebViewReceiptHelperController extends Serializable { + +} diff --git a/src/java/org/mxchange/localization/project_de_DE.properties b/src/java/org/mxchange/localization/project_de_DE.properties index adaec546..b0531713 100644 --- a/src/java/org/mxchange/localization/project_de_DE.properties +++ b/src/java/org/mxchange/localization/project_de_DE.properties @@ -133,7 +133,6 @@ ADMIN_LINK_SHOW_GENERIC_PRODUCT_CATEGORY_TITLE=Zeigt Daten der Produktkategorie ADMIN_LINK_EDIT_GENERIC_PRODUCT_CATEGORY_TITLE=Aendert Daten der Produktkategorie ab. #@TODO Please fix German umlauts! ADMIN_LINK_DELETE_GENERIC_PRODUCT_CATEGORY_TITLE=Loescht die Produktkategorie aus der Datenbank. -ADMIN_PRODUCT_GROSS_PRICE_HEADER=Bruttopreis: #@TODO Please fix German umlauts! PRODUCT_AVAILABILITY_HEADER=Produkt verfuegbar: #@TODO Please fix German umlauts! @@ -199,14 +198,14 @@ ADMIN_ENTERED_PRODUCT_I18N_KEY_ALREADY_ADDED=Der von Ihnen eingegebene Uebersetz ADMIN_ENTER_GENERIC_PRODUCT_UNIT_I18N_KEY=Uebersetzungschluessel der Einheit fuer Stueckzahl eingeben: #@TODO Please fix German umlauts! ADMIN_ENTER_GENERIC_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: +ADMIN_ASSIGN_PRODUCT_MANUFACTURER=Hersteller 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_RECEIPT_ITEM_MANUFACTURER_NAME_HEADER=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. +ENTER_RAND_NAME=Warenzeichen/Marke eingeben: +ENTER_RAND_NAME_TITLE=Geben Sie das Warenzeichen ein, dass Sie auf dem Kassenbon finden. #@TODO Please fix German umlauts! ADMIN_PRODUCT_CURRENCY_CODE_REQUIRED=Bitte geben Sie den Waehrungscode fuer das Produkt ein. Beispiele: EUR, USD, PHP #@TODO Please fix German umlauts! @@ -222,11 +221,11 @@ ADMIN_ENTER_GENERIC_PRODUCT_NUMBER_TITLE=Geben Sie die Nummer des Produktes ein. ENTER_RECEIPT_ITEM_NUMBER=Artikelnumber: ENTER_RECEIPT_ITEM_NUMBER_TITLE=Geben Sie die Artikelnummer vom Kassenbon ein. #@TODO Please fix German umlauts! -CHOOSE_RECEIPT_ITEM_IS_A_REFUND=Ist dieser Artikel eine Rueckgabe? +CHOOSE_RECEIPT_ITEM_IS_REFUND=Ist dieser Artikel eine Rueckgabe? #@TODO Please fix German umlauts! -CHOOSE_RECEIPT_ITEM_IS_A_REFUND_REQUIRED=Bitte waehlen Sie aus, ob der Artikel eine Rueckgabe ist. +CHOOSE_RECEIPT_ITEM_IS_REFUND_REQUIRED=Bitte waehlen Sie aus, ob der Artikel eine Rueckgabe ist. #@TODO Please fix German umlauts! -CHOOSE_RECEIPT_ITEM_IS_A_REFUND_TITLE=Gibt an, ob der Artikel eine Rueckgabe, zum Beispiel zurueckgegebenes Flaschenpfand, ist. +CHOOSE_RECEIPT_ITEM_IS_REFUND_TITLE=Gibt an, ob der Artikel eine Rueckgabe, zum Beispiel zurueckgegebenes Flaschenpfand, ist. ADMIN_LINK_SHOW_RECEIPT_ITEM_PRODUCT_TITLE=Zeigt Produktdaten des Artikels an. ENTER_RECEIPT_ITEM_COUPON_NUMBER=Coupon-Nummer eingeben: #@TODO Please fix German umlauts! @@ -234,11 +233,11 @@ ENTER_RECEIPT_ITEM_COUPON_NUMBER_TITLE=Geben Sie die Nummer des eingeloesten Cou ADMIN_RECEIPT_DATE_OF_ISSUE_TITLE=Bitte geben Sie das Ausstellungsdatum mit Uhrzeit fuer den Kassenbon ein. Falls Sie keine Uhrzeit haben, einfach auf 00:00 Uhr lassen. #@TODO Please fix German umlauts! ENTERED_RECEIPT_REGISTER_NUMBER_INVALID=Die eingegebene Kassennummer ist kleiner 1 oder groesser 999. -CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT=Ist dies ein Nachlass? +CHOOSE_RECEIPT_ITEM_IS_DISCOUNT=Ist dies ein Nachlass? #@TODO Please fix German umlauts! -CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT_REQUIRED=Bitte waehlen Sie aus, ob dies ein Nachlass ist. +CHOOSE_RECEIPT_ITEM_IS_DISCOUNT_REQUIRED=Bitte waehlen Sie aus, ob dies ein Nachlass ist. #@TODO Please fix German umlauts! -CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT_TITLE=Waehlen Sie aus, ob dies ein Nachlass auf einen Artikel ist. +CHOOSE_RECEIPT_ITEM_IS_DISCOUNT_TITLE=Waehlen Sie aus, ob dies ein Nachlass auf einen Artikel ist. #@TODO Please fix German umlauts! ADMIN_SELECT_PRODUCT_AGE_GROUP=Altersklasse zum Produkt auswaehlen: #@TODO Please fix German umlauts! @@ -259,7 +258,7 @@ ADMIN_PRODUCT_DETAILS_HEADER=Details zum Produkt "{0}" (Id {1}): ADMIN_SINGLE_PRODUCT_DETAILS_HEADER=Details zum einzelnen Produkt PRODUCT_ID_NUMBER_TITLE=Id-Nummer des Produktes #@TODO Please fix German umlauts! -PRODUCT_I18N_KEY_TITLE=Internationalisierungsschluessel fuer das Produkt +PRODUCT_I18N_KEY_TITLE=Internationalisierungsschluessel fuer das Produkt. #@TODO Please fix German umlauts! PRODUCT_AVAILABILITY_TITLE=Ob das Produkt zur Verfuegung steht. AGE_GROUP_HEADER=Altersgruppe: @@ -269,11 +268,8 @@ PRODUCT_HAS_NO_AGE_GROUP=Das Produkt hat keine Altersgruppe. CURRENCY_CODE_HEADER=Waehrungscode #@TODO Please fix German umlauts! PRODUCT_CURRENCY_CODE_TITLE=Waehrungscode des Produktpreises -PRODUCT_GROSS_PRICE_HEADER=Bruttopreis: PRODUCT_GROSS_PRICE_TITLE=Bruttopreis des Produktes -PRODUCT_NET_PRICE_HEADER=Nettopreis: PRODUCT_NET_PRICE_TITLE=Nettopreis des Produktes -PRODUCT_TAX_RATE_HEADER=Steuersatz: PRODUCT_TAX_RATE_TITLE=Steuersatz des Produktes PRODUCT_NUMBER_HEADER=Produktnummer: PRODUCT_NUMBER_TITLE=Nummer des Produktes @@ -335,3 +331,36 @@ CONTENT_TITLE_ADMIN_GENERIC_PRODUCT_DELETE=Produkt loeschen: ERROR_PARAMETER_PRODUCT_ID_NOT_SET=Fehler: Produkt-Id nicht gesetzt (Parameter: productId). #@TODO Please fix German umlauts! PARAMETER_PRODUCT_ID_INVALID=Parameter "productId" ist ungueltig. +ADMIN_SINGLE_RECEIPT_ITEM_DETAILS_HEADER=Details zum einzelnen Kassenboneintrag +RECEIPT_ITEM_NUMBER_HEADER=Nummer des Eintrages: +RECEIPT_ITEM_NUMBER_TITLE=Nummer des Kassenboneintrages (optional). +RECEIPT_ITEM_PRODUCT_QUANTITY_HEADER=Menge des Eintrages: +RECEIPT_ITEM_PRODUCT_QUANTITY_TITLE=Menge des Kassenboneintrages. +RECEIPT_ITEM_BRAND_NAME_TITLE=Warenzeichen des Kassenboneintrages. +PRODUCT_I18N_KEY_HEADER=Internationalisierungsschluessel des Produktes: +ADMIN_ASSIGNED_RECEIPT_ITEM_CATEGORY_HEADER=Zum Eintrag zugewiesene Kategorie: +ADMIN_ASSIGNED_RECEIPT_ITEM_CATEGORY_TITLE=Dem Kassenboneintrag zugewiesene Kategorie. +RECEIPT_ITEM_GROSS_PRICE_TITLE=Gesamtbruttopreis eines einzelnen Kassenboneintrages. +RECEIPT_ITEM_NET_PRICE_TITLE=GesamtNettopreis eines einzelnen Kassenboneintrages. +ADMIN_ASSIGNED_MANUFACTURER_HEADER=Zugewiesener Hersteller: +ADMIN_ASSIGNED_RECEIPT_ITEM_MANUFACTURER_TITLE=Zum Kassenboneintrag zugewiesene Grunddaten des Herstellers (optional). +RECEIPT_ITEM_HAS_NO_MANUFACTURER_ASSIGNED=Dieser Kassenboneintrag hat keinen Hersteller zugewiesen. +GROSS_PRICE_HEADER=Bruttopreis: +NET_PRICE_HEADER=Nettopreis: +TAX_RATE_HEADER=Steuersatz: +BRAND_NAME_HEADER=Warenzeichen: +IS_DISCOUNT_HEADER=Ist ein Nachlass? +RECEIPT_ITEM_IS_DISCOUNT_TITLE=Gibt an, ob der Kassenboneintrag ein Nachlass ist. +#@TODO Please fix German umlauts! +IS_REFUND_HEADER=Ist eine Rueckerstattung? +#@TODO Please fix German umlauts! +RECEIPT_ITEM_IS_REFUND_TITLE=Gibt an, ob der Kassenboneintrag eine Rueckerstattung ist. +ASSIGNED_RECEIPT_HEADER=Zugewiesener Kassenbon: +RECEIPT_ITEM_ASSIGNED_RECEIPT_TITLE=Dem Kassenkoneintrag zugewiesener Kassenbon. +#@TODO Please fix German umlauts! +RECEIPT_ENTRY_CREATED_TITLE=Wann dieser Kassenbon der Datenbank hinzugefuegt wurde. +ADMIN_EDIT_GENERIC_PRODUCT_TITLE=Produkt-Id {0} editieren +#@TODO Please fix German umlauts! +ADMIN_EDIT_GENERIC_PRODUCT_MINIMUM_DATA=Sie koennen hier alle Werte aendern aber geben oder waehlen Sie mindestens die markierten (*) ein/aus. +#@TODO Please fix German umlauts! +BUTTON_ADMIN_EDIT_GENERIC_PRODUCT=Allgemeines Produkt aendern diff --git a/src/java/org/mxchange/localization/project_en_US.properties b/src/java/org/mxchange/localization/project_en_US.properties index 1f7e04de..4e26cf27 100644 --- a/src/java/org/mxchange/localization/project_en_US.properties +++ b/src/java/org/mxchange/localization/project_en_US.properties @@ -99,7 +99,6 @@ FILTER_BY_MULTIPLE_PRODUCT_CATEGORIES_TITLE=Filter list by selecting one or more ADMIN_LINK_SHOW_GENERIC_PRODUCT_CATEGORY_TITLE=Shows product category data. ADMIN_LINK_EDIT_GENERIC_PRODUCT_CATEGORY_TITLE=Edits product category data. ADMIN_LINK_DELETE_GENERIC_PRODUCT_CATEGORY_TITLE=Deletes product category data. -ADMIN_PRODUCT_GROSS_PRICE_HEADER=Gross price: PRODUCT_AVAILABILITY_HEADER=Product available: ADMIN_ADD_GENERIC_PRODUCT_TITLE=Add new product ADMIN_ADD_GENERIC_PRODUCT_MINIMUM_DATA=Please choose a product category and enter product title, unit amount and type, gross price and currency code (e.g. USD). @@ -146,8 +145,8 @@ ADMIN_ASSIGN_PRODUCT_MANUFACTURER_TITLE=Assign a manufacturing/producing company SELECT_RECEIPT_ITEM_MANUFACTURER=Choose manufacturer for receipt item: ADMIN_RECEIPT_ITEM_MANUFACTURER_NAME_HEADER=Manufacturer of product item: ADMIN_ENTER_GENERIC_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. +ENTER_RAND_NAME=Enter item's brand name: +ENTER_RAND_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 @@ -159,12 +158,12 @@ ADMIN_ENTER_GENERIC_PRODUCT_NUMBER=Enter product number: ADMIN_ENTER_GENERIC_PRODUCT_NUMBER_TITLE=Enter number of product. ENTER_RECEIPT_ITEM_NUMBER=Item number: ENTER_RECEIPT_ITEM_NUMBER_TITLE=Enter receipt item's number. -CHOOSE_RECEIPT_ITEM_IS_A_REFUND=Is this item a refund? -CHOOSE_RECEIPT_ITEM_IS_A_REFUND_REQUIRED=Please choose whether the item is a refund. -CHOOSE_RECEIPT_ITEM_IS_A_REFUND_TITLE=Choose whether the item is a refund, like from a deposit of a bottle or can. -CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT=Is this item a discount? -CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT_REQUIRED=Please choose whether the item is a discount. -CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT_TITLE=Choose whether this is a discount on an item. +CHOOSE_RECEIPT_ITEM_IS_REFUND=Is this item a refund? +CHOOSE_RECEIPT_ITEM_IS_REFUND_REQUIRED=Please choose whether the item is a refund. +CHOOSE_RECEIPT_ITEM_IS_REFUND_TITLE=Choose whether the item is a refund, like from a deposit of a bottle or can. +CHOOSE_RECEIPT_ITEM_IS_DISCOUNT=Is this item a discount? +CHOOSE_RECEIPT_ITEM_IS_DISCOUNT_REQUIRED=Please choose whether the item is a discount. +CHOOSE_RECEIPT_ITEM_IS_DISCOUNT_TITLE=Choose whether this is a discount on an item. ADMIN_LINK_SHOW_RECEIPT_ITEM_PRODUCT_TITLE=Shows receipt item's product data. ENTER_RECEIPT_ITEM_COUPON_NUMBER=Enter coupon number: ENTER_RECEIPT_ITEM_COUPON_NUMBER_TITLE=Please enter the number of the used coupon. @@ -185,18 +184,15 @@ LABEL_RECEIPT_SELLERS=Seller ADMIN_PRODUCT_DETAILS_HEADER=Details of product "{0}" (Id {1}): ADMIN_SINGLE_PRODUCT_DETAILS_HEADER=Details of a single product PRODUCT_ID_NUMBER_TITLE=Id number of product -PRODUCT_I18N_KEY_TITLE=Internationalization key of product +PRODUCT_I18N_KEY_TITLE=Internationalization key of product. PRODUCT_AVAILABILITY_TITLE=Whether product is available. AGE_GROUP_HEADER=Age group: PRODUCT_AGE_GROUP_TITLE=Age group of product. PRODUCT_HAS_NO_AGE_GROUP=The product has no age group. CURRENCY_CODE_HEADER=Currency code PRODUCT_CURRENCY_CODE_TITLE=Currency code of product's price -PRODUCT_GROSS_PRICE_HEADER=Gross price: PRODUCT_GROSS_PRICE_TITLE=Gross price of product -PRODUCT_NET_PRICE_HEADER=Net price: PRODUCT_NET_PRICE_TITLE=Net price of product -PRODUCT_TAX_RATE_HEADER=Tax rate: PRODUCT_TAX_RATE_TITLE=Tax rate of product PRODUCT_NUMBER_HEADER=Product number: PRODUCT_NUMBER_TITLE=Number of product @@ -246,3 +242,31 @@ PAGE_TITLE_ADMIN_GENERIC_PRODUCT_DELETE=Delete product CONTENT_TITLE_ADMIN_GENERIC_PRODUCT_DELETE=Delete product: ERROR_PARAMETER_PRODUCT_ID_NOT_SET=Error: Product Id is not set (parameter: productId). PARAMETER_PRODUCT_ID_INVALID=Parameter "productId" is invalid. +ADMIN_SINGLE_RECEIPT_ITEM_DETAILS_HEADER=Details of a single receipt item +RECEIPT_ITEM_NUMBER_HEADER=Receipt item's number: +RECEIPT_ITEM_NUMBER_TITLE=Number of the receipt item (optional). +RECEIPT_ITEM_PRODUCT_QUANTITY_HEADER=Quantity of receipt item: +RECEIPT_ITEM_PRODUCT_QUANTITY_TITLE=Quantity of the receipt item. +RECEIPT_ITEM_BRAND_NAME_TITLE=Brand name of receipt item. +PRODUCT_I18N_KEY_HEADER=Product's internationalization key: +ADMIN_ASSIGNED_RECEIPT_ITEM_CATEGORY_HEADER=Assigned category to receipt item: +ADMIN_ASSIGNED_RECEIPT_ITEM_CATEGORY_TITLE=Category assigned to receipt item. +RECEIPT_ITEM_GROSS_PRICE_TITLE=Total gross price of a single receipt item. +RECEIPT_ITEM_NET_PRICE_TITLE=Total net price of a single receipt item. +ADMIN_ASSIGNED_MANUFACTURER_HEADER=Assigned manufacturer: +ADMIN_ASSIGNED_RECEIPT_ITEM_MANUFACTURER_TITLE=Manufacturer (basic data) assigned to receipt item (optional). +RECEIPT_ITEM_HAS_NO_MANUFACTURER_ASSIGNED=This receipt item has no manufacturer assigned. +GROSS_PRICE_HEADER=Gross price: +NET_PRICE_HEADER=Net price: +TAX_RATE_HEADER=Tax rate: +BRAND_NAME_HEADER=Brand name: +IS_DISCOUNT_HEADER=Is a discount? +RECEIPT_ITEM_IS_DISCOUNT_TITLE=Whether the receipt item is a discount. +IS_REFUND_HEADER=Is a refund? +RECEIPT_ITEM_IS_REFUND_TITLE=Whether the receipt item is a refund. +ASSIGNED_RECEIPT_HEADER=Assigned receipt: +RECEIPT_ITEM_ASSIGNED_RECEIPT_TITLE=Receipt item's assigned receipt. +RECEIPT_ENTRY_CREATED_TITLE=When this receipt entry has been added to database. +ADMIN_EDIT_GENERIC_PRODUCT_TITLE=Edit product id {0} +ADMIN_EDIT_GENERIC_PRODUCT_MINIMUM_DATA=You can edit all values here but enter or select at least all marked (*) values. +BUTTON_ADMIN_EDIT_GENERIC_PRODUCT=Change generic product diff --git a/web/WEB-INF/project-links.jsf.taglib.xml b/web/WEB-INF/project-links.jsf.taglib.xml index c1cb5658..edeaec83 100644 --- a/web/WEB-INF/project-links.jsf.taglib.xml +++ b/web/WEB-INF/project-links.jsf.taglib.xml @@ -15,10 +15,12 @@ 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"> +<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/jfinancials/links</namespace> <tag> <tag-name>outputReceiptAdminMiniLinks</tag-name> diff --git a/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt/admin_receipt_links.tpl b/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt/admin_receipt_links.tpl index 264c6ca5..49241dca 100644 --- a/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt/admin_receipt_links.tpl +++ b/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt/admin_receipt_links.tpl @@ -4,7 +4,8 @@ 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"> + xmlns:p="http://primefaces.org/ui" + > <ui:fragment rendered="#{empty rendered or rendered}"> <ul class="navbar-mini"> diff --git a/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt_item/admin_receipt_item_links.tpl b/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt_item/admin_receipt_item_links.tpl index a3157e4d..89e4c708 100644 --- a/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt_item/admin_receipt_item_links.tpl +++ b/web/WEB-INF/resources/tags/admin/links/mini/financial/receipt_item/admin_receipt_item_links.tpl @@ -4,7 +4,8 @@ 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"> + xmlns:p="http://primefaces.org/ui" + > <ui:fragment rendered="#{empty rendered or rendered}"> <ul class="navbar-mini"> 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 f62cff09..c25e5c0a 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 @@ -6,10 +6,16 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:p="http://primefaces.org/ui"> + xmlns:p="http://primefaces.org/ui" + > <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:panelGrid + layout="grid" + columns="2" + columnClasses="ui-grid-col-4,ui-grid-col-8" + styleClass="ui-noborder" + > <p:outputLabel for="branchOffice" value="#{msg.ADMIN_SELECT_BRANCH_OFFICE}" /> <p:selectOneMenu id="branchOffice" @@ -21,7 +27,7 @@ > <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}" /> + <f:selectItems value="#{branchOfficeListController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{branchOffice.branchCompany.companyName} #{branchOffice.branchStreet} #{branchOffice.branchHouseNumber}, #{branchOffice.branchCity}" /> </p:selectOneMenu> <p:outputLabel for="receiptIssued" value="#{project.ENTER_RECEIPT_ISSUE_DATE}" /> @@ -83,7 +89,12 @@ <!-- @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:panelGrid + layout="grid" + columns="2" + columnClasses="ui-grid-col-4,ui-grid-col-8" + styleClass="ui-noborder" + > <p:outputLabel for="receiptNumber" value="#{project.ENTER_RECEIPT_NUMBER}" /> <p:inputText id="receiptNumber" 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 8cbb7ab9..97566ba8 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 @@ -8,16 +8,22 @@ xmlns:product="http://mxchange.org/jsf/jproduct/widgets" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:p="http://primefaces.org/ui"> + xmlns:p="http://primefaces.org/ui" + > <p:fieldset legend="#{project.ADMIN_RECEIPT_ITEM_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="itemBrandName" value="#{project.ENTER_RECEIPT_ITEM_BRAND_NAME}" /> + <p:panelGrid + layout="grid" + columns="2" + columnClasses="ui-grid-col-4,ui-grid-col-8" + styleClass="ui-noborder" + > + <p:outputLabel for="itemBrandName" value="#{project.ENTER_RAND_NAME}" /> <p:inputText id="itemBrandName" maxlength="255" value="#{adminReceiptItemController.itemBrandName}" - title="#{project.ENTER_RECEIPT_ITEM_BRAND_NAME_TITLE}" + title="#{project.ENTER_RAND_NAME_TITLE}" /> <p:outputLabel for="itemNumber" value="#{project.ENTER_RECEIPT_ITEM_NUMBER}" /> @@ -66,23 +72,23 @@ title="#{project.ENTER_RECEIPT_ITEM_QUANTITY_TITLE}" /> - <p:outputLabel for="itemIsRefund" value="#{project.CHOOSE_RECEIPT_ITEM_IS_A_REFUND}" title="#{project.CHOOSE_RECEIPT_ITEM_IS_A_REFUND_TITLE}" /> + <p:outputLabel for="itemIsRefund" value="#{project.CHOOSE_RECEIPT_ITEM_IS_REFUND}" title="#{project.CHOOSE_RECEIPT_ITEM_IS_REFUND_TITLE}" /> <p:selectOneRadio id="itemIsRefund" value="#{adminReceiptItemController.itemIsRefund}" required="true" - requiredMessage="#{project.CHOOSE_RECEIPT_ITEM_IS_A_REFUND_REQUIRED}" + requiredMessage="#{project.CHOOSE_RECEIPT_ITEM_IS_REFUND_REQUIRED}" > <f:selectItem itemValue="#{false}" itemLabel="#{msg.CHOICE_NO}" /> <f:selectItem itemValue="#{true}" itemLabel="#{msg.CHOICE_YES}" /> </p:selectOneRadio> - <p:outputLabel for="itemIsDiscount" value="#{project.CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT}" title="#{project.CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT_TITLE}" /> + <p:outputLabel for="itemIsDiscount" value="#{project.CHOOSE_RECEIPT_ITEM_IS_DISCOUNT}" title="#{project.CHOOSE_RECEIPT_ITEM_IS_DISCOUNT_TITLE}" /> <p:selectOneRadio id="itemIsDiscount" value="#{adminReceiptItemController.itemIsDiscount}" required="true" - requiredMessage="#{project.CHOOSE_RECEIPT_ITEM_IS_A_DISCOUNT_REQUIRED}" + requiredMessage="#{project.CHOOSE_RECEIPT_ITEM_IS_DISCOUNT_REQUIRED}" > <f:selectItem itemValue="#{false}" itemLabel="#{msg.CHOICE_NO}" /> <f:selectItem itemValue="#{true}" itemLabel="#{msg.CHOICE_YES}" /> @@ -108,7 +114,7 @@ > <f:converter converterId="ReceiptConverter" /> <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" /> - <f:selectItems value="#{receiptListController.allReceipts}" var="receipt" itemValue="#{receipt}" itemLabel="#{beanHelper.renderReceipt(receipt)}" /> + <f:selectItems value="#{receiptListController.allReceipts}" var="receipt" itemValue="#{receipt}" itemLabel="#{receiptBeanHelper.renderReceipt(receipt)}" /> </p:selectOneMenu> <p:outputLabel value="#{project.ADMIN_ENTER_GENERIC_PRODUCT_PRICE}" /> diff --git a/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl b/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl index 6a5bc355..1662ce4e 100644 --- a/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl +++ b/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl @@ -5,14 +5,19 @@ xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:p="http://primefaces.org/ui"> + xmlns:p="http://primefaces.org/ui" + > <fieldset class="fieldset"> <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"> + <p:panelGrid + layout="grid" + columns="2" + columnClasses="ui-grid-col-4,ui-grid-col-8" + > <p:outputLabel for="branchOffice" value="#{project.LOGIN_SELECT_BRANCH_OFFICE}" /> <p:selectOneMenu id="branchOffice" @@ -24,7 +29,7 @@ > <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}" /> + <f:selectItems value="#{branchOfficeListController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{branchOffice.branchCompany.companyName} #{branchOffice.branchStreet} #{branchOffice.branchHouseNumber}, #{branchOffice.branchCity}" /> </p:selectOneMenu> <p:message for="branchOffice" /> @@ -76,7 +81,11 @@ <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:panelGrid + layout="grid" + columns="2" + columnClasses="ui-grid-col-4,ui-grid-col-8" + > <p:outputLabel for="receiptNumber" value="#{project.RECEIPT_NUMBER}" /> <p:inputText id="receiptNumber" @@ -88,12 +97,12 @@ <p:outputLabel for="receiptRegisterNumber" value="#{project.RECEIPT_REGISTER_NUMBER}" /> <p:inputText - id="receiptRegisterNumber" - size="3" - maxlength="10" - value="#{receiptController.receiptRegisterNumber}" - validatorMessage="#{project.ENTERED_RECEIPT_REGISTER_NUMBER_INVALID}" - > + id="receiptRegisterNumber" + size="3" + maxlength="10" + value="#{receiptController.receiptRegisterNumber}" + validatorMessage="#{project.ENTERED_RECEIPT_REGISTER_NUMBER_INVALID}" + > <f:validateLongRange minimum="1" maximum="999" /> </p:inputText> diff --git a/web/admin/financial/receipt/admin_receipt_list.xhtml b/web/admin/financial/receipt/admin_receipt_list.xhtml index b3be3052..69821d59 100644 --- a/web/admin/financial/receipt/admin_receipt_list.xhtml +++ b/web/admin/financial/receipt/admin_receipt_list.xhtml @@ -1,13 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> -<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl" - xmlns="http://www.w3.org/1999/xhtml" - xmlns:core="http://mxchange.org/jsf/core/widgets" - xmlns:pl="http://mxchange.org/jsf/jfinancials/links" - xmlns:links="http://mxchange.org/jsf/core/links" - xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:h="http://xmlns.jcp.org/jsf/html" - xmlns:f="http://xmlns.jcp.org/jsf/core" - xmlns:p="http://primefaces.org/ui"> +<ui:composition + template="/WEB-INF/templates/admin/admin_base.tpl" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:core="http://mxchange.org/jsf/core/widgets" + xmlns:pl="http://mxchange.org/jsf/jfinancials/links" + xmlns:links="http://mxchange.org/jsf/core/links" + xmlns:ui="http://xmlns.jcp.org/jsf/facelets" + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core" + xmlns:p="http://primefaces.org/ui" + > <ui:define name="document_admin_title"> <h:outputText value="#{project.PAGE_TITLE_ADMIN_FINANCIALS_RECEIPT_LIST}" /> @@ -23,7 +25,6 @@ id="receiptList" var="receipt" value="#{receiptListController.allReceipts}" - tableStyleClass="table table-full" paginator="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" filteredValue="#{receiptListController.filteredReceipts}" @@ -45,14 +46,25 @@ <p:panelGrid columns="3" layout="grid" columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"> <p:spacer /> - <p:panelGrid columns="2" columnClasses="ui-grid-4,ui-grid-8" layout="grid" styleClass="table table-full ui-noborder"> + <p:panelGrid + columns="2" + columnClasses="ui-grid-4,ui-grid-8" + layout="grid" + styleClass="ui-noborder" + > <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" /> <p:inputText id="globalFilter" onkeyup="PF('receiptList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/> </p:panelGrid> <p:outputPanel> <p:spacer height="4" /> - <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" /> + <p:commandButton + id="toggler" + type="button" + value="#{msg.SELECT_SHOWN_COLUMNS}" + styleClass="column-selector" + /> + <p:columnToggler datasource="receiptList" trigger="toggler" /> </p:outputPanel> </p:panelGrid> @@ -81,7 +93,7 @@ title="#{msg.FILTER_BY_MULTIPLE_BRANCH_OFFICES_TITLE}" > <f:converter converterId="BranchOfficeConverter" /> - <f:selectItems value="#{branchOfficeController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" /> + <f:selectItems value="#{branchOfficeListController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" /> </p:selectCheckboxMenu> </f:facet> @@ -141,8 +153,8 @@ </p:column> <p:column headerText="#{msg.ADMIN_DATE_OF_ISSUE}" sortBy="#{receipt.receiptIssued}" filterBy="#{receipt.receiptIssued}"> - <h:outputText id="receiptIssued" value="#{receipt.receiptIssued.time}"> - <f:convertDateTime for="receiptIssued" type="both" timeStyle="short" dateStyle="short" /> + <h:outputText id="receiptIssued" value="#{receipt.receiptIssued}"> + <f:convertDateTime type="both" timeStyle="short" dateStyle="short" /> </h:outputText> </p:column> @@ -176,11 +188,11 @@ hideEffect="fade" showEffect="fade" widgetVar="receiptDialog" - position="center,center" + position="top" responsive="true" > <p:outputPanel id="receipt-details"> - <p:panelGrid columns="2" rendered="#{not empty receiptListController.selectedReceipt}" columnClasses="label,value"> + <p:panelGrid columns="2" rendered="#{not empty receiptListController.selectedReceipt}"> <f:facet name="header"> <h:outputFormat value="#{project.ADMIN_RECEIPT_DETAILS_HEADER}"> <f:param value="#{receiptListController.selectedReceipt.receiptId}" /> @@ -194,8 +206,8 @@ <h:outputText value="#{receiptListController.selectedReceipt.receiptNumber}" /> <p:outputLabel value="#{project.RECEIPT_ISSUED}" title="#{project.RECEIPT_ISSUED_TITLE}" /> - <h:outputText id="receiptIssued" value="#{receiptListController.selectedReceipt.receiptIssued.time}"> - <f:convertDateTime for="receiptIssued" type="both" timeStyle="short" dateStyle="short" /> + <h:outputText value="#{receiptListController.selectedReceipt.receiptIssued}"> + <f:convertDateTime type="both" timeStyle="short" dateStyle="short" /> </h:outputText> <p:outputLabel value="#{msg.BRANCH_OFFICE}" title="#{project.ASSIGNED_RECEIPT_BRANCH_OFFICE_TITLE}" /> @@ -223,13 +235,21 @@ <p:outputLabel value="#{msg.PAYMENT_TYPE}" title="#{project.RECEIPT_PAYMENT_TYPE_TITLE}" /> <h:outputText value="#{msg[receiptListController.selectedReceipt.receiptPaymentType.i18nKey]}" /> + + <p:outputLabel value="#{msg.ENTRY_CREATED_HEADER}" title="#{project.RECEIPT_ENTRY_CREATED_TITLE}" /> + <h:outputText value="#{receiptListController.selectedReceipt.receiptCreated}"> + <f:convertDateTime type="both" timeStyle="short" dateStyle="short" /> + </h:outputText> </p:panelGrid> </p:outputPanel> </p:dialog> </h:form> <h:form id="form-add-receipt"> - <p:panelGrid layout="grid" columns="1" styleClass="table table-full"> + <p:panelGrid + layout="grid" + columns="1" + > <h:panelGroup styleClass="table-header" layout="block"> <h4> <h:outputText value="#{project.ADMIN_ADD_RECEIPT_TITLE}" /> @@ -238,7 +258,7 @@ <ui:include src="/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl" /> - <p:panelGrid columns="2" styleClass="table-footer" layout="grid"> + <p:panelGrid columns="2" layout="grid"> <p:commandButton styleClass="reset" type="reset" @@ -246,7 +266,7 @@ /> <p:commandButton - styleClass="submit" + process="@form" type="submit" value="#{project.BUTTON_ADMIN_ADD_RECEIPT}" action="#{adminReceiptController.addReceipt()}" diff --git a/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml b/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml index 16967d33..a0758a72 100644 --- a/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml +++ b/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml @@ -8,7 +8,8 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" - xmlns:p="http://primefaces.org/ui"> + xmlns:p="http://primefaces.org/ui" + > <ui:define name="document_admin_title"> <h:outputText value="#{project.PAGE_TITLE_ADMIN_FINANCIALS_RECEIPT_ITEM_LIST}" /> @@ -24,7 +25,6 @@ id="receiptItemList" var="receiptItem" value="#{receiptItemListController.allReceiptItems}" - tableStyleClass="table table-full" paginator="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" filteredValue="#{receiptItemListController.filteredReceiptItems}" @@ -46,14 +46,26 @@ <p:panelGrid columns="3" layout="grid" columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"> <p:spacer /> - <p:panelGrid columns="2" columnClasses="ui-grid-4,ui-grid-8" layout="grid" styleClass="table table-full ui-noborder"> + <p:panelGrid + columns="2" + columnClasses="ui-grid-4,ui-grid-8" + layout="grid" + styleClass="ui-noborder" + > <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" /> <p:inputText id="globalFilter" onkeyup="PF('receiptItemList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/> </p:panelGrid> <p:outputPanel> <p:spacer height="4" /> - <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" /> + + <p:commandButton + id="toggler" + type="button" + value="#{msg.SELECT_SHOWN_COLUMNS}" + styleClass="column-selector" + /> + <p:columnToggler datasource="receiptItemList" trigger="toggler" /> </p:outputPanel> </p:panelGrid> @@ -67,7 +79,7 @@ <p:column headerText="#{msg.ID_NUMBER_HEADER}" sortBy="#{receiptItem.itemId}" filterBy="#{receiptItem.itemId}"> <p:link outcome="admin_show_receipt_item" title="#{project.ADMIN_LINK_SHOW_RECEIPT_ITEM_TITLE}" value="#{receiptItem.itemId}"> - <f:param name="receiptId" value="#{receiptItem.itemId}" /> + <f:param name="receiptItemId" value="#{receiptItem.itemId}" /> </p:link> </p:column> @@ -82,11 +94,11 @@ title="#{project.FILTER_BY_MULTIPLE_RECEIPTS_TITLE}" > <f:converter converterId="ReceiptConverter" /> - <f:selectItems value="#{receiptListController.allReceipts}" var="receipt" itemValue="#{receipt}" itemLabel="#{beanHelper.renderReceipt(receipt)}" /> + <f:selectItems value="#{receiptListController.allReceipts}" var="receipt" itemValue="#{receipt}" itemLabel="#{receiptBeanHelper.renderReceipt(receipt)}" /> </p:selectCheckboxMenu> </f:facet> - <p:link outcome="admin_show_receipt" title="#{project.ADMIN_LINK_SHOW_RECEIPT_TITLE}" value="#{beanHelper.renderReceipt(receiptItem.itemReceipt)}"> + <p:link outcome="admin_show_receipt" title="#{project.ADMIN_LINK_SHOW_RECEIPT_TITLE}" value="#{receiptBeanHelper.renderReceipt(receiptItem.itemReceipt)}"> <f:param name="receiptId" value="#{receiptItem.itemReceipt.receiptId}" /> </p:link> </p:column> @@ -130,12 +142,12 @@ <f:param name="basicDataId" value="#{receiptItem.itemManufacturer.basicDataId}" /> </p:link> - <h:outputText value="#{msg.ADMIN_NOT_ASSIGNED}" title="#{project.ADMIN_NO_PRODUCT_MANUFACTURER_ASSIGNED_TITLE}" rendered="#{empty receiptItem.itemManufacturer}" /> + <h:outputText value="#{msg.ADMIN_NOT_ASSIGNED}" title="#{project.ADMIN_NO_RECEIPT_ITEM_MANUFACTURER_ASSIGNED_TITLE}" rendered="#{empty receiptItem.itemManufacturer}" /> </p:column> <p:column headerText="#{msg.ENTRY_CREATED_HEADER}" sortBy="#{receipt.receiptCreated}" filterable="false"> - <h:outputText id="itemCreated" value="#{receiptItem.itemCreated.time}"> - <f:convertDateTime for="itemCreated" type="both" timeStyle="short" dateStyle="short" /> + <h:outputText id="itemCreated" value="#{receiptItem.itemCreated}"> + <f:convertDateTime type="both" timeStyle="short" dateStyle="short" /> </h:outputText> </p:column> @@ -152,11 +164,11 @@ hideEffect="fade" showEffect="fade" widgetVar="receiptItemDialog" - position="center,center" + position="top" responsive="true" > <p:outputPanel id="receipt-item-details"> - <p:panelGrid columns="2" rendered="#{not empty receiptItemListController.selectedReceiptItem}" columnClasses="label,value"> + <p:panelGrid columns="2" rendered="#{not empty receiptItemListController.selectedReceiptItem}"> <f:facet name="header"> <h:outputFormat value="#{project.ADMIN_RECEIPT_DETAILS_HEADER}"> <f:param value="#{receiptItemListController.selectedReceiptItem.itemId}" /> @@ -165,13 +177,83 @@ <p:outputLabel value="#{msg.ID_NUMBER_HEADER}" title="#{project.RECEIPT_ID_NUMBER_TITLE}" /> <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemId}" /> + + <p:outputLabel value="#{project.RECEIPT_ITEM_NUMBER_HEADER}" title="#{project.RECEIPT_ITEM_NUMBER_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemNumber}" /> + + <p:outputLabel value="#{project.RECEIPT_ITEM_PRODUCT_QUANTITY_HEADER}" title="#{project.RECEIPT_ITEM_PRODUCT_QUANTITY_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemProductQuantity}" /> + + <p:outputLabel value="#{project.BRAND_NAME_HEADER}" title="#{project.RECEIPT_ITEM_BRAND_NAME_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemBrandName}" /> + + <p:outputLabel value="#{project.PRODUCT_I18N_KEY_HEADER}" title="#{project.PRODUCT_I18N_KEY_TITLE}" /> + <p:link outcome="admin_show_generic_product" title="#{project.ADMIN_LINK_SHOW_RECEIPT_ITEM_PRODUCT_TITLE}" value="#{local[receiptItemListController.selectedReceiptItem.itemProduct.productI18nKey]}"> + <f:param name="productId" value="#{receiptItemListController.selectedReceiptItem.itemProduct.productId}" /> + </p:link> + + <p:outputLabel value="#{project.ADMIN_ASSIGNED_RECEIPT_ITEM_CATEGORY_HEADER}" title="#{project.ADMIN_ASSIGNED_RECEIPT_ITEM_CATEGORY_TITLE}" /> + <p:link outcome="admin_show_product_category" title="#{project.ADMIN_LINK_SHOW_RECEIPT_ITEM_CATEGORY_TITLE}" value="#{local[receiptItemListController.selectedReceiptItem.itemCategory.categoryI18nKey]}"> + <f:param name="categoryId" value="#{receiptItemListController.selectedReceiptItem.itemCategory.categoryId}" /> + </p:link> + + <p:outputLabel value="#{project.ADMIN_ASSIGNED_MANUFACTURER_HEADER}" title="#{project.ADMIN_ASSIGNED_RECEIPT_ITEM_MANUFACTURER_TITLE}" /> + <p:link + outcome="admin_show_basic_data" + title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}" + rendered="#{not empty receiptItemListController.selectedReceiptItem.itemManufacturer}" + > + <h:outputFormat value="#{msg.BASIC_DATA_LINK_MASK}"> + <f:param value="#{receiptItemListController.selectedReceiptItem.itemManufacturer.companyName}" /> + <f:param value="#{receiptItemListController.selectedReceiptItem.itemManufacturer.basicDataId}" /> + </h:outputFormat> + <f:param name="basicDataId" value="#{receiptItemListController.selectedReceiptItem.itemManufacturer.basicDataId}" /> + </p:link> + <h:outputText value="#{project.RECEIPT_ITEM_HAS_NO_MANUFACTURER_ASSIGNED}" rendered="#{empty receiptItemListController.selectedReceiptItem.itemManufacturer}" /> + + <p:outputLabel value="#{project.GROSS_PRICE_HEADER}" title="#{project.RECEIPT_ITEM_GROSS_PRICE_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemGrossPrice}"> + <!-- @TODO Hard-coded EUR again --> + <f:convertNumber type="currency" currencyCode="EUR" /> + </h:outputText> + + <p:outputLabel value="#{project.NET_PRICE_HEADER}" title="#{project.RECEIPT_ITEM_NET_PRICE_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemNetPrice}"> + <!-- @TODO Hard-coded EUR again --> + <f:convertNumber type="currency" currencyCode="EUR" /> + </h:outputText> + + <p:outputLabel value="#{project.TAX_RATE_HEADER}" title="#{project.RECEIPT_ITEM_TAX_RATE_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemTaxRate}"> + <!-- @TODO No real percentage number, 7.0 means 7.0%, not 700% --> + <f:convertNumber type="number" /> + </h:outputText> + + <p:outputLabel value="#{project.IS_DISCOUNT_HEADER}" title="#{project.RECEIPT_ITEM_IS_DISCOUNT_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemIsDiscount ? msg.CHOICE_YES : msg.CHOICE_NO}" /> + + <p:outputLabel value="#{project.IS_REFUND_HEADER}" title="#{project.RECEIPT_ITEM_IS_REFUND_TITLE}" /> + <h:outputText value="#{receiptItemListController.selectedReceiptItem.itemIsRefund ? msg.CHOICE_YES : msg.CHOICE_NO}" /> + + <p:outputLabel value="#{project.ASSIGNED_RECEIPT_HEADER}" title="#{project.RECEIPT_ITEM_ASSIGNED_RECEIPT_TITLE}" /> + <p:link outcome="admin_show_receipt" title="#{project.ADMIN_LINK_SHOW_RECEIPT_TITLE}" value="#{receiptBeanHelper.renderReceipt(receiptItemListController.selectedReceiptItem.itemReceipt)}"> + <f:param name="receiptId" value="#{receiptItemListController.selectedReceiptItem.itemReceipt.receiptId}" /> + </p:link> + + <p:outputLabel value="#{msg.ENTRY_CREATED_HEADER}" title="#{project.RECEIPT_ITEM_CREATED_TITLE}" /> + <h:outputText id="itemCreated" value="#{receiptItemListController.selectedReceiptItem.itemCreated}"> + <f:convertDateTime type="both" timeStyle="short" dateStyle="short" /> + </h:outputText> </p:panelGrid> </p:outputPanel> </p:dialog> </h:form> <h:form id="form-add-receipt-item"> - <p:panelGrid layout="grid" columns="1" styleClass="table table-full"> + <p:panelGrid + columns="1" + layout="grid" + > <h:panelGroup styleClass="table-header" layout="block"> <h4> <h:outputText value="#{project.ADMIN_ADD_RECEIPT_ITEM_TITLE}" /> @@ -180,7 +262,7 @@ <ui:include src="/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl" /> - <p:panelGrid columns="2" styleClass="table-footer" layout="grid"> + <p:panelGrid columns="2" layout="grid"> <p:commandButton styleClass="reset" type="reset" @@ -188,7 +270,7 @@ /> <p:commandButton - styleClass="submit" + process="@form" type="submit" value="#{project.BUTTON_ADMIN_ADD_RECEIPT_TEM}" action="#{adminReceiptItemController.addReceiptItem()}" diff --git a/web/user/financials/login_financials_add_income.xhtml b/web/user/financials/login_financials_add_income.xhtml index fde9c1f5..d1acad00 100644 --- a/web/user/financials/login_financials_add_income.xhtml +++ b/web/user/financials/login_financials_add_income.xhtml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> -<ui:composition template="/WEB-INF/templates/login/user/user_base.tpl" - xmlns="http://www.w3.org/1999/xhtml" - xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:h="http://xmlns.jcp.org/jsf/html" - xmlns:f="http://xmlns.jcp.org/jsf/core" - xmlns:p="http://primefaces.org/ui"> +<ui:composition + template="/WEB-INF/templates/login/user/user_base.tpl" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://xmlns.jcp.org/jsf/facelets" + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core" + xmlns:p="http://primefaces.org/ui" + > <ui:define name="document_login_title"> <h:outputText value="#{project.PAGE_TITLE_LOGIN_FINANCIAL_ADD_INCOME}" /> @@ -16,7 +18,7 @@ <ui:define name="content"> <h:form id="form_add_financials_income"> - <h:panelGroup styleClass="table table-full" layout="block"> + <h:panelGroup layout="block"> <div class="table-header"> <h:outputText value="#{project.LOGIN_FINANCIAL_ADD_INCOME_FORM_TITLE}" /> </div> @@ -64,11 +66,19 @@ </div> </h:panelGroup> - <div class="table-footer"> - <p:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" /> + <p:panelGrid columns="2" layout="grid"> + <p:commandButton + type="reset" + value="#{msg.BUTTON_RESET_FORM}" + /> - <p:commandButton styleClass="submit" id="submit_add_income" type="submit" action="#{financialIncomeController.addIncome()}" value="#{project.BUTTON_LOGIN_FINANCIAL_ADD_INCOME}" /> - </div> + <p:commandButton + process="@form" + type="submit" + value="#{project.BUTTON_LOGIN_FINANCIAL_ADD_INCOME}" + action="#{financialIncomeController.addIncome()}" + /> + </p:panelGrid> </h:panelGroup> </h:form> </ui:define> diff --git a/web/user/financials/login_financials_add_receipt.xhtml b/web/user/financials/login_financials_add_receipt.xhtml index 92febe16..270c8760 100644 --- a/web/user/financials/login_financials_add_receipt.xhtml +++ b/web/user/financials/login_financials_add_receipt.xhtml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> -<ui:composition template="/WEB-INF/templates/login/user/user_base.tpl" - xmlns="http://www.w3.org/1999/xhtml" - xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:h="http://xmlns.jcp.org/jsf/html" - xmlns:f="http://xmlns.jcp.org/jsf/core" - xmlns:p="http://primefaces.org/ui"> +<ui:composition + template="/WEB-INF/templates/login/user/user_base.tpl" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://xmlns.jcp.org/jsf/facelets" + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core" + xmlns:p="http://primefaces.org/ui" + > <ui:define name="document_login_title"> <h:outputText value="#{project.PAGE_TITLE_LOGIN_FINANCIAL_ADD_RECEIPT}" /> @@ -16,7 +18,10 @@ <ui:define name="content"> <h:form id="form_add_financial_receipt"> - <p:panelGrid layout="grid" columns="1" headerClass="table-header" footerClass="table-footer" styleClass="table table-full"> + <p:panelGrid + columns="1" + layout="grid" + > <f:facet name="header"> <h:outputText value="#{project.LOGIN_ADD_RECEIPT_TITLE}" /> </f:facet> @@ -26,8 +31,17 @@ </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_RECEIPT}" action="#{receiptController.addReceipt()}" /> + <p:commandButton + type="reset" + value="#{msg.BUTTON_RESET_FORM}" + /> + + <p:commandButton + process="@form" + type="submit" + value="#{project.BUTTON_LOGIN_ADD_RECEIPT}" + action="#{receiptController.addReceipt()}" + /> </f:facet> </p:panelGrid> </h:form> diff --git a/web/user/financials/login_financials_overview.xhtml b/web/user/financials/login_financials_overview.xhtml index 2b85206a..5b92d7a2 100644 --- a/web/user/financials/login_financials_overview.xhtml +++ b/web/user/financials/login_financials_overview.xhtml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> -<ui:composition template="/WEB-INF/templates/login/user/user_base.tpl" - xmlns="http://www.w3.org/1999/xhtml" - xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:h="http://xmlns.jcp.org/jsf/html" - xmlns:f="http://xmlns.jcp.org/jsf/core" - xmlns:p="http://primefaces.org/ui"> +<ui:composition + template="/WEB-INF/templates/login/user/user_base.tpl" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://xmlns.jcp.org/jsf/facelets" + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core" + xmlns:p="http://primefaces.org/ui" + > <ui:define name="document_login_title"> <h:outputText value="#{project.PAGE_TITLE_LOGIN_FINANCIAL_OVERVIEW}" /> @@ -21,23 +23,23 @@ <h:outputText value="#{project.GENERAL_FINANCIAL_OVERVIEW}" /> </f:facet> - <h:column> + <p:column> <p:outputLabel for="totalReceipts" styleClass="data_label" value="#{project.USER_FINANCIALS_TOTAL_RECEIPTS}" /> <h:outputLink id="totalReceipts" styleClass="data_field" target="list_user_financial_receipts" value="#{fn:length(financialIncomeController.receipts)}" /> - </h:column> + </p:column> - <h:column> + <p:column> <p:outputLabel for="totalReceipts" styleClass="data_label" value="#{project.USER_FINANCIALS_TOTAL_OTHER_EXPENSES}" /> <h:outputLink id="totalReceipts" styleClass="data_field" target="list_user_financial_other_expenses" value="#{fn:length(financialIncomeController.otherExpenses)}" /> - </h:column> + </p:column> - <h:column> + <p:column> <p:outputLabel for="totalReceipts" styleClass="data_label" value="#{project.USER_FINANCIALS_TOTAL_INCOME}" /> <h:outputLink id="totalReceipts" styleClass="data_field" target="list_user_financial_income" value="#{fn:length(financialIncomeController.incomes)}" /> - </h:column> + </p:column> </p:panelGrid> </h:panelGroup> -- 2.39.5