From 885878b9abb904754ca1f515fd3776ce04445daf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 14 Oct 2017 19:01:28 +0200 Subject: [PATCH] Don't cherry-pick: - added backing bean for general and administrative purposes for receipt items - added list view for receipt items - added form template for receipt items - added JSF custom tag for administrative links - some language strings reassigned from msg (general) to project-specific message bundle - added navigation case for listing receipt items MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../FinancialAdminReceiptWebRequestBean.java | 6 +- .../FinancialsReceiptWebRequestBean.java | 13 +- ...nancialAdminReceiptItemWebRequestBean.java | 139 ++++++++ ...lAdminReceiptItemWebRequestController.java | 28 ++ .../FinancialsReceiptItemWebRequestBean.java | 308 ++++++++++++++++++ ...ncialsReceiptItemWebRequestController.java | 38 +++ .../localization/project_de_DE.properties | 6 + .../localization/project_en_US.properties | 4 + web/WEB-INF/faces-config.xml | 4 + web/WEB-INF/project-links.jsf.taglib.xml | 25 +- .../admin_form_financial_receipt_item.tpl | 101 ++++++ web/WEB-INF/templates/admin/menu/project.tpl | 1 + .../admin_receipt_item_list.xhtml | 185 +++++++++++ .../receipts/admin_receipt_list.xhtml | 2 +- 14 files changed, 847 insertions(+), 13 deletions(-) create mode 100644 src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java create mode 100644 src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestController.java create mode 100644 src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestBean.java create mode 100644 src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestController.java create mode 100644 web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl create mode 100644 web/admin/financials/receipt_items/admin_receipt_item_list.xhtml diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java index 0c797f2e..c1626722 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialAdminReceiptWebRequestBean.java @@ -30,7 +30,7 @@ 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.exceptions.ReceiptAlreadyAddedException; +import org.mxchange.jfinancials.exceptions.receipt.ReceiptAlreadyAddedException; import org.mxchange.jfinancials.model.receipt.BillableReceipt; import org.mxchange.jfinancials.model.receipt.FinancialAdminReceiptSessionBeanRemote; import org.mxchange.jfinancials.model.receipt.FinancialReceipt; @@ -62,7 +62,7 @@ public class FinancialAdminReceiptWebRequestBean extends BaseFinancialsBean impl * EJB for general financial receipt purposes */ @EJB (lookup = "java:global/jfinancials-ejb/adminFinancialReceipt!org.mxchange.jfinancials.model.receipt.FinancialAdminReceiptSessionBeanRemote") - private FinancialAdminReceiptSessionBeanRemote adminFinancialBean; + private FinancialAdminReceiptSessionBeanRemote adminReceiptBean; /** * Bar-code number @@ -158,7 +158,7 @@ public class FinancialAdminReceiptWebRequestBean extends BaseFinancialsBean impl // All is set, then try to call EJB try { // Add it - updatedReceipt = this.adminFinancialBean.addReceipt(receipt); + updatedReceipt = this.adminReceiptBean.addReceipt(receipt); } catch (final ReceiptAlreadyAddedException ex) { // Throw it again throw new FaceletException(ex); diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java index b1dc31e3..9ff56943 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/FinancialsReceiptWebRequestBean.java @@ -40,7 +40,7 @@ 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.ReceiptAlreadyAddedException; +import org.mxchange.jfinancials.exceptions.receipt.ReceiptAlreadyAddedException; import org.mxchange.jfinancials.model.receipt.BillableReceipt; import org.mxchange.jfinancials.model.receipt.FinancialReceipt; import org.mxchange.jfinancials.model.receipt.FinancialReceiptSessionBeanRemote; @@ -48,7 +48,7 @@ import org.mxchange.jproduct.model.payment.PaymentType; import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent; /** - * An administrative financial receipt bean (controller) + * A general financial receipt bean (controller) *

* @author Roland Häder */ @@ -435,15 +435,12 @@ public class FinancialsReceiptWebRequestBean extends BaseFinancialsBean implemen // Is cache there? if (!this.receiptCache.iterator().hasNext()) { // Get whole list - final List list = this.receiptBean.allReceipts(); + final List receipts = this.receiptBean.allReceipts(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final BillableReceipt next = iterator.next(); - + for (final BillableReceipt receipt : receipts) { // Add it to cache - this.receiptCache.put(next.getReceiptId(), next); + this.receiptCache.put(receipt.getReceiptId(), receipt); } } diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java new file mode 100644 index 00000000..df8336da --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestBean.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.jfinancials.beans.financial.model.receipt_item; + +import java.text.MessageFormat; +import javax.ejb.EJB; +import javax.enterprise.context.RequestScoped; +import javax.enterprise.event.Event; +import javax.enterprise.inject.Any; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import org.mxchange.jfinancials.beans.BaseFinancialsBean; +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.item.BillableReceiptItem; +import org.mxchange.jfinancials.model.receipt.item.FinancialReceiptItem; +import org.mxchange.jfinancials.model.receipt_item.FinancialAdminReceiptItemSessionBeanRemote; + +/** + * An administrative backing bean for receipt items + *

+ * @author Roland Häder + */ +@Named ("adminReceiptItemController") +@RequestScoped +public class FinancialAdminReceiptItemWebRequestBean extends BaseFinancialsBean implements FinancialAdminReceiptItemWebRequestController { + + /** + * Serial number + */ + private static final long serialVersionUID = 595_754_280_374_172L; + + /** + * Event being fired when administrator has added a new receipt item + */ + @Inject + @Any + private Event adminAddedReceiptItemEvent; + + /** + * EJB for general financial receipt item purposes + */ + @EJB (lookup = "java:global/jfinancials-ejb/adminFinancialReceiptItem!org.mxchange.jfinancials.model.receipt.item.FinancialAdminReceiptItemSessionBeanRemote") + private FinancialAdminReceiptItemSessionBeanRemote adminReceiptItemBean; + + /** + * General receipt item controller + */ + @Inject + private FinancialsReceiptItemWebRequestController receiptItemController; + + /** + * Default constructor + */ + public FinancialAdminReceiptItemWebRequestBean () { + // Call super constructor + super(); + } + + /** + * Adds the completed receipt item to database by calling an EJB business + * method. If not all required fields are set, a proper exception is being + * thrown. + *

+ * @return Link outcome + */ + public String addReceiptItem () { + // Are all required fields set? + + // Prepare receipt item instance + final BillableReceiptItem receiptItem = this.createReceiptItemInstance(); + + // Is the receipt already there? + if (this.receiptItemController.isReceiptItemAdded(receiptItem)) { + // Receipt has already been added + throw new FaceletException(MessageFormat.format("Receipt for itemReceipt.receiptId={0},itemProduct.productId={1},itemProductQuantity={2} has already been added.", receiptItem.getItemReceipt().getReceiptId(), receiptItem.getItemProduct().getProductId(), receiptItem.getItemProductQuantity())); //NOI18N + } + + // Init variable + final BillableReceiptItem updatedReceiptItem; + + // All is set, then try to call EJB + try { + // Add it + updatedReceiptItem = this.adminReceiptItemBean.addReceiptItem(receiptItem); + } catch (final ReceiptItemAlreadyAddedException ex) { + // Throw it again + throw new FaceletException(ex); + } + + // Fire event with updated instance + this.adminAddedReceiptItemEvent.fire(new ReceiptItemAddedEvent(updatedReceiptItem)); + + // Clear bean + this.clear(); + + // Return redirect outcome + return "add_receipt_item?faces-redirect=true"; //NOI18N + } + + /** + * Clears this bean + */ + private void clear () { + // Clear all fields + } + + /** + * Creates a new instance from all available data of this bean. + *

+ * @return Receipt item instance + */ + private BillableReceiptItem createReceiptItemInstance () { + // Create new instance with minimum required data + final BillableReceiptItem receiptItem = new FinancialReceiptItem(); + + // Set optional data + + // Return prepared instance + return receiptItem; + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestController.java new file mode 100644 index 00000000..db4a5e6a --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialAdminReceiptItemWebRequestController.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.jfinancials.beans.financial.model.receipt_item; + +import java.io.Serializable; + +/** + * An interface for administrative receipt item beans + *

+ * @author Roland Häder + */ +public interface FinancialAdminReceiptItemWebRequestController extends Serializable { + +} diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestBean.java new file mode 100644 index 00000000..843e1199 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestBean.java @@ -0,0 +1,308 @@ +/* + * 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 . + */ +package org.mxchange.jfinancials.beans.financial.model.receipt_item; + +import fish.payara.cdi.jsr107.impl.NamedCache; +import java.text.MessageFormat; +import java.util.Comparator; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.PostConstruct; +import javax.cache.Cache; +import javax.ejb.EJB; +import javax.enterprise.context.RequestScoped; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; +import javax.enterprise.inject.Any; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import org.mxchange.jfinancials.beans.BaseFinancialsBean; +import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController; +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.item.BillableReceiptItem; +import org.mxchange.jfinancials.model.receipt.item.FinancialReceiptItem; +import org.mxchange.jfinancials.model.receipt_item.FinancialReceiptItemSessionBeanRemote; +import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent; + +/** + * A general financial receipt item bean (controller) + *

+ * @author Roland Häder + */ +@Named ("receiptItemController") +@RequestScoped +public class FinancialsReceiptItemWebRequestBean extends BaseFinancialsBean implements FinancialsReceiptItemWebRequestController { + + /** + * Serial number + */ + private static final long serialVersionUID = 56_189_028_928_372L; + + /** + * Event being fired when user has added a new receipt + */ + @Inject + @Any + private Event addedReceiptItemEvent; + + /** + * All receipt items list + */ + private final List allReceiptItems; + + /** + * Filtered receipt items list + */ + private List filteredReceiptItems; + + /** + * EJB for general financial receipt purposes + */ + @EJB (lookup = "java:global/jfinancials-ejb/financialReceiptItem!org.mxchange.jfinancials.model.receipt.item.FinancialReceiptItemSessionBeanRemote") + private FinancialReceiptItemSessionBeanRemote receiptItemBean; + + /** + * A list of all branch offices (globally) + */ + @Inject + @NamedCache (cacheName = "receiptItemCache") + private Cache receiptItemCache; + + /** + * User instance + */ + @Inject + private FinancialsUserLoginWebSessionController userLoginController; + + /** + * User's receipt items + */ + private final List userReceiptItems; + + /** + * Constructor + */ + @SuppressWarnings ("CollectionWithoutInitialCapacity") + public FinancialsReceiptItemWebRequestBean () { + // Call super constructor + super(); + + // Init lists + this.allReceiptItems = new LinkedList<>(); + this.userReceiptItems = new LinkedList<>(); + } + + /** + * Adds the completed receipt item to database by calling an EJB business method. + * If not all required fields are set, a proper exception is being thrown. + *

+ * @return Link outcome + */ + public String addReceiptItem () { + // Are all required fields set? + if (!this.userLoginController.isUserLoggedIn()) { + // Not logged-in + throw new IllegalStateException("User is not logged-in"); //NOI18N + } + + // Prepare receipt instance + final BillableReceiptItem receiptItem = this.createReceiptInstance(); + + // Is the receipt already there? + if (this.isReceiptItemAdded(receiptItem)) { + // Receipt has already been added + throw new FaceletException(MessageFormat.format("Receipt for itemReceipt.receiptId={0},itemProduct.productId={1},itemProductQuantity={2} has already been added.", receiptItem.getItemReceipt().getReceiptId(), receiptItem.getItemProduct().getProductId(), receiptItem.getItemProductQuantity())); //NOI18N + } + + // Init variable + final BillableReceiptItem updatedReceiptItem; + + // All is set, then try to call EJB + try { + // Add it + updatedReceiptItem = this.receiptItemBean.addReceiptItem(receiptItem); + } catch (final ReceiptItemAlreadyAddedException ex) { + // Throw it again + throw new FaceletException(ex); + } + + // Fire event with updated instance + this.addedReceiptItemEvent.fire(new ReceiptItemAddedEvent(updatedReceiptItem)); + + // Clear bean + this.clear(); + + // Return redirect outcome + return "add_receipt_item?faces-redirect=true"; //NOI18N + } + + /** + * Observes events being fired when a new receipt item has been added + *

+ * @param event Event being fired + */ + public void afterAddedReceiptItemEvent (@Observes final ObservableReceiptItemAddedEvent event) { + // Validate parameter + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } + + // Add to cache and general list + this.receiptItemCache.put(event.getReceiptItem().getItemId(), event.getReceiptItem()); + this.allReceiptItems.add(event.getReceiptItem()); + + // Is same user? + if (this.userLoginController.isUserLoggedIn() && Objects.equals(event.getReceiptItem().getItemReceipt().getReceiptUser(), this.userLoginController.getLoggedInUser())) { + // Same user, then add it + this.userReceiptItems.add(event.getReceiptItem()); + } + } + + /** + * Event observer for logged-in user + *

+ * @param event Event instance + */ + public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) { + // event should not be null + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getLoggedInUser() == null) { + // Throw NPE again + throw new NullPointerException("event.loggedInUser is null"); //NOI18N + } else if (event.getLoggedInUser().getUserId() == null) { + // userId is null + throw new NullPointerException("event.loggedInUser.userId is null"); //NOI18N + } else if (event.getLoggedInUser().getUserId() < 1) { + // Not avalid id + throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N + } + + // Fill cache with all found user's receipts + for (final BillableReceiptItem receiptItem : this.allReceiptItems) { + // Is same user? + if (Objects.equals(receiptItem.getItemReceipt().getReceiptUser(), event.getLoggedInUser())) { + // Yes, then add it + this.userReceiptItems.add(receiptItem); + } + } + } + + /** + * Returns all receipt items + *

+ * @return All receipt items + */ + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List allReceiptItems () { + return this.allReceiptItems; + } + + /** + * Getter for filtered receipt items + *

+ * @return Filtered receipts + */ + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List getFilteredReceiptItems () { + return this.filteredReceiptItems; + } + + /** + * Setter for filtered receipt items + *

+ * @param filteredReceiptItems Filtered receipt items + */ + @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") + public void setFilteredReceipts (final List filteredReceiptItems) { + this.filteredReceiptItems = filteredReceiptItems; + } + + @PostConstruct + public void initCache () { + // Is cache there? + if (!this.receiptItemCache.iterator().hasNext()) { + // Get whole list + final List receiptItems = this.receiptItemBean.allReceiptItems(); + + // Add all + for (final BillableReceiptItem receiptItem : receiptItems) { + // Add it to cache + this.receiptItemCache.put(receiptItem.getItemId(), receiptItem); + } + } + + // Is the list empty, but filled cache? + if (this.allReceiptItems.isEmpty() && this.receiptItemCache.iterator().hasNext()) { + // Get iterator + final Iterator> iterator = this.receiptItemCache.iterator(); + + // Build up list + while (iterator.hasNext()) { + // GEt next element + final Cache.Entry next = iterator.next(); + + // Add to list + this.allReceiptItems.add(next.getValue()); + } + + // Sort list + this.allReceiptItems.sort(new Comparator() { + @Override + public int compare (final BillableReceiptItem o1, final BillableReceiptItem o2) { + return o1.getItemId() > o2.getItemId() ? 1 : o1.getItemId() < o2.getItemId() ? -1 : 0; + } + } + ); + } + } + + @Override + public boolean isReceiptItemAdded (final BillableReceiptItem receiptItem) { + // Always trust the cache + return this.allReceiptItems.contains(receiptItem); + } + + /** + * Clears this bean + */ + private void clear () { + // Clear all fields + } + + /** + * Returns a fully created receipt item instance (except primary key, of course) + *

+ * @return Receipt item instance + */ + private BillableReceiptItem createReceiptInstance () { + // Init receipt instance + final BillableReceiptItem receiptItem = new FinancialReceiptItem(); + + // Set optional fields + + // Return it + return receiptItem; + } +} diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestController.java new file mode 100644 index 00000000..164349ee --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/FinancialsReceiptItemWebRequestController.java @@ -0,0 +1,38 @@ +/* + * 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 . + */ +package org.mxchange.jfinancials.beans.financial.model.receipt_item; + +import java.io.Serializable; +import org.mxchange.jfinancials.model.receipt.item.BillableReceiptItem; + +/** + * An administrative interface for financial receipt item beans + *

+ * @author Roland Häder + */ +public interface FinancialsReceiptItemWebRequestController extends Serializable { + + /** + * Checks if receipt item has already been added to database + *

+ * @param receiptItem Prepared receipt item instance + *

+ * @return Whether the receipt item has already been added + */ + boolean isReceiptItemAdded (final BillableReceiptItem receiptItem); + +} diff --git a/src/java/org/mxchange/localization/project_de_DE.properties b/src/java/org/mxchange/localization/project_de_DE.properties index f2b81a3f..04b8eee9 100644 --- a/src/java/org/mxchange/localization/project_de_DE.properties +++ b/src/java/org/mxchange/localization/project_de_DE.properties @@ -65,3 +65,9 @@ ADMIN_LINK_SHOW_RECEIPT_OWNER_USER_TITLE=Zeigt zugewiesenen Benutzer des Kassenb #@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 +#@TODO Please fix German umlauts! +ADMIN_LINK_LIST_FINANCIAL_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. diff --git a/src/java/org/mxchange/localization/project_en_US.properties b/src/java/org/mxchange/localization/project_en_US.properties index bf56b773..5f298e44 100644 --- a/src/java/org/mxchange/localization/project_en_US.properties +++ b/src/java/org/mxchange/localization/project_en_US.properties @@ -52,3 +52,7 @@ ADMIN_FINANCIAL_RECEIPT_OTHER_LEGEND_TITLE=Enter other additional data you can f 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_SHOW_RECEIPT_TITLE=Shows receipt data. +ADMIN_LINK_SHOW_RECEIPT_ITEM_TITLE=Shows receipt item data. diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 30de4b7c..5e4b319e 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -168,6 +168,10 @@ admin_list_receipts /admin/financials/receipts/admin_receipt_list.xhtml + + admin_list_receipt_items + /admin/financials/receipt_items/admin_receipt_item_list.xhtml + /user/login_index.xhtml diff --git a/web/WEB-INF/project-links.jsf.taglib.xml b/web/WEB-INF/project-links.jsf.taglib.xml index b84b0793..d3b60efa 100644 --- a/web/WEB-INF/project-links.jsf.taglib.xml +++ b/web/WEB-INF/project-links.jsf.taglib.xml @@ -32,7 +32,30 @@ along with this program. If not, see . renderShowLink - Whether this tag is used to show mobile data (default true). + Whether this tag is used to show receipt data (default true). + false + java.lang.Boolean + + + rendered + Whether this tag is being rendered by JSF engine (default: true). + false + java.lang.Boolean + + + + outputReceiptItemAdminMiniLinks + This tag renders a full h:panelGroup for administrative "mini-links" for receipt item data. + resources/tags/admin/links/mini/financial/receipt_item/admin_receipt_item_links.tpl + + receiptItem + The receipt item instance that provides the data for this tag. + true + org.mxchange.jfinancials.model.receipt.item.BillableReceiptItem + + + renderShowLink + Whether this tag is used to show receipt item data (default true). false java.lang.Boolean 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 new file mode 100644 index 00000000..270316ea --- /dev/null +++ b/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/WEB-INF/templates/admin/menu/project.tpl b/web/WEB-INF/templates/admin/menu/project.tpl index f0d00989..3de0e50c 100644 --- a/web/WEB-INF/templates/admin/menu/project.tpl +++ b/web/WEB-INF/templates/admin/menu/project.tpl @@ -8,5 +8,6 @@ + diff --git a/web/admin/financials/receipt_items/admin_receipt_item_list.xhtml b/web/admin/financials/receipt_items/admin_receipt_item_list.xhtml new file mode 100644 index 00000000..8f4cd6d8 --- /dev/null +++ b/web/admin/financials/receipt_items/admin_receipt_item_list.xhtml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +

+ + + + + + + + + + + + + diff --git a/web/admin/financials/receipts/admin_receipt_list.xhtml b/web/admin/financials/receipts/admin_receipt_list.xhtml index 936a2e49..69c8fe4a 100644 --- a/web/admin/financials/receipts/admin_receipt_list.xhtml +++ b/web/admin/financials/receipts/admin_receipt_list.xhtml @@ -48,7 +48,7 @@ - + -- 2.39.5