import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jfinancials.beans.financial.model.receipt.list.FinancialsReceiptListWebViewController;
import org.mxchange.jfinancials.events.receipt.added.ObservableReceiptAddedEvent;
import org.mxchange.jfinancials.events.receipt.added.ReceiptAddedEvent;
import org.mxchange.jfinancials.exceptions.receipt.ReceiptAlreadyAddedException;
*/
private Date receiptIssued;
+ /**
+ * Receipt list controller
+ */
+ @Inject
+ private FinancialsReceiptListWebViewController receiptListController;
+
/**
* Receipt number (only numbers)
*/
final BillableReceipt receipt = this.createReceiptInstance();
// Is the receipt already there?
- if (this.receiptController.isReceiptAdded(receipt)) {
+ if (this.receiptListController.isReceiptAdded(receipt)) {
// Receipt has already been added
throw new FaceletException(MessageFormat.format("Receipt for receiptBranchOffice={0},receiptIssued={1},receiptNumber={2} has already been added.", this.getReceiptBranchOffice().getBranchId(), this.getReceiptIssued().toString(), this.getReceiptNumber())); //NOI18N
}
*/
package org.mxchange.jfinancials.beans.financial.model.receipt;
-import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
-import java.util.Comparator;
import java.util.Date;
-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 org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jfinancials.beans.financial.model.receipt.list.FinancialsReceiptListWebViewController;
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;
import org.mxchange.jproduct.model.payment.PaymentType;
-import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
/**
* A general financial receipt bean (controller)
@Any
private Event<ObservableReceiptAddedEvent> addedReceiptEvent;
- /**
- * All receipts list
- */
- private final List<BillableReceipt> allReceipts;
-
- /**
- * Filtered receipts list
- */
- private List<BillableReceipt> filteredReceipts;
-
/**
* Bar-code number
*/
private BranchOffice receiptBranchOffice;
/**
- * A list of all branch offices (globally)
+ * Date/time the receipt has been issued
*/
- @Inject
- @NamedCache (cacheName = "receiptCache")
- private Cache<Long, BillableReceipt> receiptCache;
+ private Date receiptIssued;
/**
- * Date/time the receipt has been issued
+ * Receipt list controller
*/
- private Date receiptIssued;
+ @Inject
+ private FinancialsReceiptListWebViewController receiptListController;
/**
* Receipt number (only numbers)
@Inject
private FinancialsUserLoginWebSessionController userLoginController;
- /**
- * User's receipts
- */
- private final List<BillableReceipt> userReceipts;
-
/**
* Constructor
*/
public FinancialsReceiptWebRequestBean () {
// Call super constructor
super();
-
- // Init lists
- this.allReceipts = new LinkedList<>();
- this.userReceipts = new LinkedList<>();
}
/**
final BillableReceipt receipt = this.createReceiptInstance();
// Is the receipt already there?
- if (this.isReceiptAdded(receipt)) {
+ if (this.receiptListController.isReceiptAdded(receipt)) {
// Receipt has already been added
throw new FaceletException(MessageFormat.format("Receipt for receiptBranchOffice={0},receiptIssued={1},receiptNumber={2} has already been added.", this.getReceiptBranchOffice().getBranchId(), this.getReceiptIssued().toString(), this.getReceiptNumber())); //NOI18N
}
return "admin_list_receipts?faces-redirect=true"; //NOI18N
}
- /**
- * Observes events being fired when a new receipt has been added
- * <p>
- * @param event Event being fired
- */
- public void afterAddedReceiptEvent (@Observes final ObservableReceiptAddedEvent event) {
- // Validate parameter
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getReceipt() == null) {
- // Throw NPE again
- throw new NullPointerException("event.receipt is null"); //NOI18N
- } else if (event.getReceipt().getReceiptId() == null) {
- // Throw it again
- throw new NullPointerException("event.receipt.receiptId is null"); //NOI18N
- } else if (event.getReceipt().getReceiptId() < 1) {
- // Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("event.receipt.receiptId={0} is invalid", event.getReceipt().getReceiptId())); //NOI18N
- }
-
- // Add to cache and general list
- this.receiptCache.put(event.getReceipt().getReceiptId(), event.getReceipt());
- this.allReceipts.add(event.getReceipt());
-
- // Is same user?
- if (this.userLoginController.isUserLoggedIn() && Objects.equals(event.getReceipt().getReceiptUser(), this.userLoginController.getLoggedInUser())) {
- // Same user, then add it
- this.userReceipts.add(event.getReceipt());
- }
- }
-
- /**
- * Event observer for logged-in user
- * <p>
- * @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 BillableReceipt receipt : this.allReceipts) {
- // Is same user?
- if (Objects.equals(receipt.getReceiptUser(), event.getLoggedInUser())) {
- // Yes, then add it
- this.userReceipts.add(receipt);
- }
- }
- }
-
- /**
- * Returns all receipts
- * <p>
- * @return All receipts
- */
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
- public List<BillableReceipt> allReceipts () {
- 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>
- * @return Filtered receipts
- */
- @SuppressWarnings ("ReturnOfCollectionOrArrayField")
- public List<BillableReceipt> getFilteredReceipts () {
- return this.filteredReceipts;
- }
-
- /**
- * Setter for filtered receipts
- * <p>
- * @param filteredReceipts Filtered receipts
- */
- @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
- public void setFilteredReceipts (final List<BillableReceipt> filteredReceipts) {
- this.filteredReceipts = filteredReceipts;
- }
-
/**
* Getter for receipt's bar-code number
* <p>
this.receiptSellerEmployee = receiptSellerEmployee;
}
- @PostConstruct
- public void initCache () {
- // Is cache there?
- if (!this.receiptCache.iterator().hasNext()) {
- // Get whole list
- final List<BillableReceipt> receipts = this.receiptBean.allReceipts();
-
- // Add all
- for (final BillableReceipt receipt : receipts) {
- // Add it to cache
- this.receiptCache.put(receipt.getReceiptId(), receipt);
- }
- }
-
- // Is the list empty, but filled cache?
- if (this.allReceipts.isEmpty() && this.receiptCache.iterator().hasNext()) {
- // Get iterator
- final Iterator<Cache.Entry<Long, BillableReceipt>> iterator = this.receiptCache.iterator();
-
- // Build up list
- while (iterator.hasNext()) {
- // GEt next element
- final Cache.Entry<Long, BillableReceipt> next = iterator.next();
-
- // Add to list
- this.allReceipts.add(next.getValue());
- }
-
- // Sort list
- this.allReceipts.sort(new Comparator<BillableReceipt>() {
- @Override
- public int compare (final BillableReceipt o1, final BillableReceipt o2) {
- return o1.getReceiptId() > o2.getReceiptId() ? 1 : o1.getReceiptId() < o2.getReceiptId() ? -1 : 0;
- }
- }
- );
- }
- }
-
- @Override
- public boolean isReceiptAdded (final BillableReceipt receipt) {
- // Always trust the cache
- return this.allReceipts.contains(receipt);
- }
-
/**
* Clears this bean
*/
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;
/**
* An administrative interface for financial receipt beans
*/
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>
- * @param receipt Prepared receipt instance
- * <p>
- * @return Whether the receipt has already been added
- */
- boolean isReceiptAdded (final BillableReceipt receipt);
-
}
--- /dev/null
+/*
+ * Copyright (C) 2017, 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.financial.model.receipt.list;
+
+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 javax.annotation.PostConstruct;
+import javax.cache.Cache;
+import javax.ejb.EJB;
+import javax.enterprise.event.Observes;
+import javax.faces.view.ViewScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jfinancials.events.receipt.added.ObservableReceiptAddedEvent;
+import org.mxchange.jfinancials.exceptions.receipt.ReceiptNotFoundException;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
+import org.mxchange.jfinancials.model.receipt.FinancialReceiptSessionBeanRemote;
+
+/**
+ * A view-scoped bean for receipt lists
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("receiptListController")
+@ViewScoped
+public class FinancialsReceiptListWebViewBean extends BaseFinancialsBean implements FinancialsReceiptListWebViewController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 34_869_872_672_653L;
+
+ /**
+ * All receipts list
+ */
+ private final List<BillableReceipt> allReceipts;
+
+ /**
+ * Filtered receipts list
+ */
+ private List<BillableReceipt> filteredReceipts;
+
+ /**
+ * EJB for general financial receipt purposes
+ */
+ @EJB (lookup = "java:global/jfinancials-ejb/financialReceipt!org.mxchange.jfinancials.model.receipt.FinancialReceiptSessionBeanRemote")
+ private FinancialReceiptSessionBeanRemote receiptBean;
+
+ /**
+ * A list of all branch offices (globally)
+ */
+ @Inject
+ @NamedCache (cacheName = "receiptCache")
+ private transient Cache<Long, BillableReceipt> receiptCache;
+
+ /**
+ * Selected receipt
+ */
+ private BillableReceipt selectedReceipt;
+
+ /**
+ * Default constructor
+ */
+ public FinancialsReceiptListWebViewBean () {
+ // Call super constructor
+ super();
+
+ // Init lists
+ this.allReceipts = new LinkedList<>();
+ }
+
+ /**
+ * Observes events being fired when a new receipt has been added
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterAddedReceiptEvent (@Observes final ObservableReceiptAddedEvent event) {
+ // Validate parameter
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getReceipt() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.receipt is null"); //NOI18N
+ } else if (event.getReceipt().getReceiptId() == null) {
+ // Throw it again
+ throw new NullPointerException("event.receipt.receiptId is null"); //NOI18N
+ } else if (event.getReceipt().getReceiptId() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("event.receipt.receiptId={0} is invalid", event.getReceipt().getReceiptId())); //NOI18N
+ }
+
+ // Add to cache and general list
+ this.receiptCache.put(event.getReceipt().getReceiptId(), event.getReceipt());
+ this.getAllReceipts().add(event.getReceipt());
+ }
+
+ @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;
+ }
+
+ @Override
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<BillableReceipt> getAllReceipts () {
+ return this.allReceipts;
+ }
+
+ /**
+ * Getter for filtered receipts
+ * <p>
+ * @return Filtered receipts
+ */
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<BillableReceipt> getFilteredReceipts () {
+ return this.filteredReceipts;
+ }
+
+ /**
+ * Setter for filtered receipts
+ * <p>
+ * @param filteredReceipts Filtered receipts
+ */
+ @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+ public void setFilteredReceipts (final List<BillableReceipt> filteredReceipts) {
+ this.filteredReceipts = filteredReceipts;
+ }
+
+ /**
+ * Getter for selected receipt
+ * <P>
+ * @return Selected receipt
+ */
+ public BillableReceipt getSelectedReceipt () {
+ return this.selectedReceipt;
+ }
+
+ /**
+ * Setter for selected receipt
+ * <P>
+ * @param selectedReceipt Selected receipt
+ */
+ public void setSelectedReceipt (final BillableReceipt selectedReceipt) {
+ this.selectedReceipt = selectedReceipt;
+ }
+
+ @PostConstruct
+ public void initCache () {
+ // Is cache there?
+ if (!this.receiptCache.iterator().hasNext()) {
+ // Get whole list
+ final List<BillableReceipt> receipts = this.receiptBean.allReceipts();
+
+ // Add all
+ for (final BillableReceipt receipt : receipts) {
+ // Add it to cache
+ this.receiptCache.put(receipt.getReceiptId(), receipt);
+ }
+ }
+
+ // Is the list empty, but filled cache?
+ if (this.getAllReceipts().isEmpty() && this.receiptCache.iterator().hasNext()) {
+ // Get iterator
+ final Iterator<Cache.Entry<Long, BillableReceipt>> iterator = this.receiptCache.iterator();
+
+ // Build up list
+ while (iterator.hasNext()) {
+ // GEt next element
+ final Cache.Entry<Long, BillableReceipt> next = iterator.next();
+
+ // Add to list
+ this.getAllReceipts().add(next.getValue());
+ }
+
+ // Sort list
+ this.getAllReceipts().sort(new Comparator<BillableReceipt>() {
+ @Override
+ public int compare (final BillableReceipt o1, final BillableReceipt o2) {
+ return o1.getReceiptId() > o2.getReceiptId() ? 1 : o1.getReceiptId() < o2.getReceiptId() ? -1 : 0;
+ }
+ }
+ );
+ }
+ }
+
+ @Override
+ public boolean isReceiptAdded (final BillableReceipt receipt) {
+ // Always trust the cache
+ return this.getAllReceipts().contains(receipt);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 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.financial.model.receipt.list;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jfinancials.exceptions.receipt.ReceiptNotFoundException;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
+
+/**
+ * An interface of receipt list backing beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsReceiptListWebViewController 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>
+ * @param receipt Prepared receipt instance
+ * <p>
+ * @return Whether the receipt has already been added
+ */
+ boolean isReceiptAdded (final BillableReceipt receipt);
+
+ /**
+ * Returns all receipts
+ * <p>
+ * @return All receipts
+ */
+ public List<BillableReceipt> getAllReceipts ();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017, 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.financial.model.receipt.user;
+
+import java.text.MessageFormat;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Objects;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+import org.mxchange.jfinancials.beans.financial.model.receipt.list.FinancialsReceiptListWebViewController;
+import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
+import org.mxchange.jfinancials.events.receipt.added.ObservableReceiptAddedEvent;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
+
+/**
+ * A view-scoped bean for receipt lists
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("userReceiptController")
+@SessionScoped
+public class FinancialsReceiptUserWebSessionBean extends BaseFinancialsBean implements FinancialsReceiptUserWebSessionController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 34_869_872_672_654L;
+
+ /**
+ * Receipt list controller
+ */
+ @Inject
+ private FinancialsReceiptListWebViewController receiptListController;
+
+ /**
+ * User instance
+ */
+ @Inject
+ private FinancialsUserLoginWebSessionController userLoginController;
+
+ /**
+ * User's receipts
+ */
+ private final List<BillableReceipt> userReceipts;
+
+ /**
+ * Default constructor
+ */
+ public FinancialsReceiptUserWebSessionBean () {
+ // Call super constructor
+ super();
+
+ // Init lists
+ this.userReceipts = new LinkedList<>();
+ }
+
+ /**
+ * Observes events being fired when a new receipt has been added
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterAddedReceiptEvent (@Observes final ObservableReceiptAddedEvent event) {
+ // Validate parameter
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getReceipt() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.receipt is null"); //NOI18N
+ } else if (event.getReceipt().getReceiptId() == null) {
+ // Throw it again
+ throw new NullPointerException("event.receipt.receiptId is null"); //NOI18N
+ } else if (event.getReceipt().getReceiptId() < 1) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("event.receipt.receiptId={0} is invalid", event.getReceipt().getReceiptId())); //NOI18N
+ }
+
+ // Is same user?
+ if (this.userLoginController.isUserLoggedIn() && Objects.equals(event.getReceipt().getReceiptUser(), this.userLoginController.getLoggedInUser())) {
+ // Same user, then add it
+ this.getUserReceipts().add(event.getReceipt());
+ }
+ }
+
+ /**
+ * Event observer for logged-in user
+ * <p>
+ * @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 BillableReceipt receipt : this.receiptListController.getAllReceipts()) {
+ // Is same user?
+ if (Objects.equals(receipt.getReceiptUser(), event.getLoggedInUser())) {
+ // Yes, then add it
+ this.getUserReceipts().add(receipt);
+ }
+ }
+ }
+
+ /**
+ * Getter for user's receipts
+ * <p>
+ * @return User's receipts
+ */
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<BillableReceipt> getUserReceipts () {
+ return this.userReceipts;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 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.financial.model.receipt.user;
+
+import java.io.Serializable;
+
+/**
+ * An interface of user's receipt backing beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsReceiptUserWebSessionController extends Serializable {
+
+}
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;
-import org.mxchange.jfinancials.beans.financial.model.receipt.FinancialsReceiptWebRequestBean;
-import org.mxchange.jfinancials.beans.financial.model.receipt.FinancialsReceiptWebRequestController;
+import org.mxchange.jfinancials.beans.financial.model.receipt.list.FinancialsReceiptListWebViewBean;
+import org.mxchange.jfinancials.beans.financial.model.receipt.list.FinancialsReceiptListWebViewController;
import org.mxchange.jfinancials.exceptions.receipt.ReceiptNotFoundException;
import org.mxchange.jfinancials.model.receipt.BillableReceipt;
/**
* Receipt backing bean
*/
- private static FinancialsReceiptWebRequestController RECEIPT_CONTROLLER;
+ private static FinancialsReceiptListWebViewController RECEIPT_LIST_CONTROLLER;
@Override
public BillableReceipt getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
// Is the instance there?
- if (null == RECEIPT_CONTROLLER) {
+ if (null == RECEIPT_LIST_CONTROLLER) {
// Get bean from CDI directly
- RECEIPT_CONTROLLER = CDI.current().select(FinancialsReceiptWebRequestBean.class).get();
+ RECEIPT_LIST_CONTROLLER = CDI.current().select(FinancialsReceiptListWebViewBean.class).get();
}
// Is the value null or empty?
final Long receiptId = Long.valueOf(submittedValue);
// Try to get user instance from it
- receipt = RECEIPT_CONTROLLER.findReceiptById(receiptId);
+ receipt = RECEIPT_LIST_CONTROLLER.findReceiptById(receiptId);
} catch (final NumberFormatException ex) {
// Throw again
throw new ConverterException(ex);
ADMIN_MENU_RECEIPTS_TITLE=Kassenbons & Eintraege
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=Bitte geben Sie hier die Grunddaten des neuen Kassenbons ein.
ENTER_RECEIPT_ISSUE_DATE=Ausstellungsdatum des Kassenbons eingeben:
CATEGORY_PARENT_HEADER=Elternkategorie:
CATEGORY_PARENT_TITLE=Elternkategorie dieser Kategorie.
CATEGORY_HAS_NO_PARENT=Diese Kategorie hat keine Elternkategorie.
+ADMIN_SINGLE_RECEIPT_DETAILS_HEADER=Details zum einzelnen Kassenbon
+ADMIN_RECEIPT_DETAILS_HEADER=Details zur Kassenbon-Id {0}:
+#@TODO Please fix German umlauts!
+ADMIN_LINK_SHOW_RECEIPT_SELLER_EMPLOYEE_TITLE=Zeigt zugewiesenen Verkaeufer des Kassenbons an.
+#@TODO Please fix German umlauts!
+ADMIN_LINK_ASSIGN_RECEIPT_SELLER_EMPLOYEE_TITLE=Verkaeufer dem Kassenbon zuweisen.
+ADMIN_LINK_ASSIGN_RECEIPT_OWNER_USER_TITLE=Besitzenden Benutzer dem Kassenbon zuweisen.
+RECEIPT_NUMBER_TITLE=Nummer des Kassenbons.
+RECEIPT_ISSUED_TITLE=Wann dieser Kassenbon ausgestellt wurde.
+ASSIGNED_RECEIPT_BRANCH_OFFICE_TITLE=Zugewiesene Filiale zum Kassenbons:
+SELLER_HEADER=Verkaeufer:
+#@TODO Please fix German umlauts!
+ASSIGNED_RECEIPT_SELLER_TITLE=Zugewiesener Verkaeufer zum Kassenbon:
+#@TODO Please fix German umlauts!
+NO_SELLER_ASSIGNED_TO_RECEIPT=Kein Verkaeufer dem Kassenbon zugewiesen.
+ASSIGNED_RECEIPT_USER_TITLE=Zugewiesener Benutzer zum Kassenbon.
+NO_USER_ASSIGNED_TO_RECEIPT=Kein Benutzer dem Kassenbon zugewiesen.
+RECEIPT_ID_NUMBER_TITLE=Id-Nummer des Kassenbonus.
+RECEIPT_BARCODE_HEADER=Streifencode:
+RECEIPT_BARCODE_TITLE=Streifencode des Kassenbons.
+RECEIPT_SEQUENCE_NUMBER_HEADER=Durchlaufende Nummer:
+RECEIPT_SEQUENCE_NUMBER_TITLE=Durchlaufende Nummer des Kassenbons.
+RECEIPT_PAYMENT_TYPE_TITLE=Bezahlungsart des Kassenbons.
ADMIN_MENU_RECEIPTS_TITLE=Receipts & Items
ADMIN_LINK_LIST_RECEIPTS_TITLE=Lists all registered receipts.
ADMIN_LINK_LIST_RECEIPTS=Receipts
-ADMIN_LIST_RECEIPTS_HEADER=List all receipts
ADMIN_RECEIPT_BASIC_LEGEND=Basic data of receipt:
ADMIN_RECEIPT_BASIC_LEGEND_TITLE=Please enter here basic data of the new receipt.
ENTER_RECEIPT_ISSUE_DATE=Enter date of issue of receipt:
CATEGORY_PARENT_HEADER=Parent category:
CATEGORY_PARENT_TITLE=Parent category of this category.
CATEGORY_HAS_NO_PARENT=This category has no parent category.
+ADMIN_SINGLE_RECEIPT_DETAILS_HEADER=Details of a single receipt
+ADMIN_RECEIPT_DETAILS_HEADER=Details of receipt id {0}:
+ADMIN_LINK_SHOW_RECEIPT_SELLER_EMPLOYEE_TITLE=Shows assigned seller employee of receipt.
+ADMIN_LINK_ASSIGN_RECEIPT_SELLER_EMPLOYEE_TITLE=Assign seller to receipt.
+ADMIN_LINK_ASSIGN_RECEIPT_OWNER_USER_TITLE=Assign owning user to receipt.
+RECEIPT_NUMBER_TITLE=Number of receipt.
+RECEIPT_ISSUED_TITLE=When this receipt has been issued.
+ASSIGNED_RECEIPT_BRANCH_OFFICE_TITLE=Assigned branch office of receipt:
+SELLER_HEADER=Seller:
+ASSIGNED_RECEIPT_SELLER_TITLE=Assigned seller of receipt:
+NO_SELLER_ASSIGNED_TO_RECEIPT=No seller assigned to receipt.
+ASSIGNED_RECEIPT_USER_TITLE=Assigned user of receipt.
+NO_USER_ASSIGNED_TO_RECEIPT=No user assigned to receipt.
+RECEIPT_ID_NUMBER_TITLE=Id number of receipt.
+RECEIPT_BARCODE_HEADER=Barcode:
+RECEIPT_BARCODE_TITLE=Barcode of receipt.
+RECEIPT_SEQUENCE_NUMBER_HEADER=Sequence number:
+RECEIPT_SEQUENCE_NUMBER_TITLE=Sequence number of receipt.
+RECEIPT_PAYMENT_TYPE_TITLE=Payment type of receipt.
>
<f:converter converterId="ReceiptConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
- <f:selectItems value="#{receiptController.allReceipts()}" var="receipt" itemValue="#{receipt}" itemLabel="#{beanHelper.renderReceipt(receipt)}" />
+ <f:selectItems value="#{receiptListController.allReceipts}" var="receipt" itemValue="#{receipt}" itemLabel="#{beanHelper.renderReceipt(receipt)}" />
</p:selectOneMenu>
<p:outputLabel value="#{project.ADMIN_ENTER_GENERIC_PRODUCT_PRICE}" />
</ui:define>
<ui:define name="content">
- <h:form id="form-list-financial-receipt">
+ <h:form id="form-list-financial-receipts">
<p:dataTable
id="receiptList"
var="receipt"
- value="#{receiptController.allReceipts()}"
- filteredValue="#{receiptController.filteredReceipts}"
+ value="#{receiptListController.allReceipts}"
tableStyleClass="table table-full"
- rows="10"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ filteredValue="#{receiptListController.filteredReceipts}"
+ rows="10"
+ rowKey="#{receipt.receiptId}"
reflow="true"
resizableColumns="true"
rowsPerPageTemplate="5,10,20,50,100"
summary="#{project.TABLE_SUMMARY_ADMIN_LIST_RECEIPTS}"
emptyMessage="#{project.ADMIN_EMPTY_LIST_RECEIPT}"
widgetVar="receiptList"
+ selectionMode="single"
+ selection="#{receiptListController.selectedReceipt}"
+ skipChildren="true"
>
+
<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_RECEIPTS_HEADER}" />
+ <p:panelGrid columns="3" layout="grid" columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2">
+ <p:spacer />
- <h:panelGroup>
+ <p:panelGrid columns="2" columnClasses="ui-grid-4,ui-grid-8" layout="grid" styleClass="table table-full 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:columnToggler datasource="receiptList" trigger="toggler" />
- </h:panelGroup>
- </p:panelGrid >
+ </p:outputPanel>
+ </p:panelGrid>
</f:facet>
+ <p:ajax
+ event="rowSelect"
+ update=":master:form-list-financial-receipts:receipt-details"
+ oncomplete="PF('receiptDialog').show()"
+ />
+
<p:column headerText="#{msg.ID_NUMBER_HEADER}" sortBy="#{receipt.receiptId}" filterBy="#{receipt.receiptId}">
<p:link outcome="admin_show_receipt" title="#{project.ADMIN_LINK_SHOW_RECEIPT_TITLE}" value="#{receipt.receiptId}">
<f:param name="receiptId" value="#{receipt.receiptId}" />
title="#{msg.FILTER_BY_MULTIPLE_BRANCH_OFFICES_TITLE}"
>
<f:converter converterId="BranchOfficeConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{branchOfficeController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" />
</p:selectCheckboxMenu>
</f:facet>
</p:selectCheckboxMenu>
</f:facet>
- <p:link outcome="admin_show_employee" title="#{msg.ADMIN_LINK_SHOW_RECEIPT_SELLER_EMPLOYEE_TITLE}" value="#{beanHelper.renderEmployee(receipt.receiptSellerEmployee)}" rendered="#{not empty receipt.receiptSellerEmployee}">
+ <p:link outcome="admin_show_employee" title="#{project.ADMIN_LINK_SHOW_RECEIPT_SELLER_EMPLOYEE_TITLE}" value="#{beanHelper.renderEmployee(receipt.receiptSellerEmployee)}" rendered="#{not empty receipt.receiptSellerEmployee}">
<f:param name="userId" value="#{receipt.receiptSellerEmployee.employeeId}" />
</p:link>
- <p:link outcome="admin_assign_receipt_seller" title="#{msg.ADMIN_LINK_ASSIGN_RECEIPT_SELLER_EMPLOYEE_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty receipt.receiptSellerEmployee}">
+ <p:link outcome="admin_assign_receipt_seller" title="#{project.ADMIN_LINK_ASSIGN_RECEIPT_SELLER_EMPLOYEE_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty receipt.receiptSellerEmployee}">
<f:param name="receiptId" value="#{receipt.receiptId}" />
</p:link>
</p:column>
</p:selectCheckboxMenu>
</f:facet>
- <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_RECEIPT_OWNER_USER_TITLE}" value="#{receipt.receiptUser.userId}" rendered="#{not empty receipt.receiptUser}">
+ <p:link outcome="admin_show_user" title="#{project.ADMIN_LINK_SHOW_RECEIPT_OWNER_USER_TITLE}" value="#{beanHelper.renderUser(receipt.receiptUser)}" rendered="#{not empty receipt.receiptUser}">
<f:param name="userId" value="#{receipt.receiptUser.userId}" />
</p:link>
- <p:link outcome="admin_assign_receipt_user" title="#{msg.ADMIN_LINK_ASSIGN_RECEIPT_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty receipt.receiptUser}">
+ <p:link outcome="admin_assign_receipt_user" title="#{project.ADMIN_LINK_ASSIGN_RECEIPT_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty receipt.receiptUser}">
<f:param name="receiptId" value="#{receipt.receiptId}" />
</p:link>
</p:column>
</h:outputText>
</p:column>
- <p:column headerText="#{msg.ADMIN_PAYMENT_TYPE}" sortBy="#{receipt.receiptPaymentType}" filterBy="#{receipt.receiptPaymentType}">
+ <p:column headerText="#{msg.ADMIN_PAYMENT_TYPE}" sortBy="#{receipt.receiptPaymentType}" filterBy="#{receipt.receiptPaymentType}" filterMatchMode="in">
<f:facet name="filter">
- <p:selectOneMenu
+ <p:selectCheckboxMenu
filter="true"
filterMatchMode="contains"
label="#{msg.LABEL_PAYMENT_TYPES}"
+ updateLabel="true"
onchange="PF('receiptList').filter()"
- title="#{msg.FILTER_BY_MULTIPLE_PAYMENT_TYPES_TITLE}"
>
<f:converter converterId="PaymentTypeConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{dataController.paymentTypes}" var="paymentType" itemValue="#{paymentType}" itemLabel="#{msg[paymentType.i18nKey]}" />
- </p:selectOneMenu>
+ </p:selectCheckboxMenu>
</f:facet>
<h:outputText value="#{msg[receipt.receiptPaymentType.i18nKey]}" />
<pl:outputReceiptAdminMiniLinks receipt="#{receipt}" />
</p:column>
</p:dataTable>
+
+ <p:dialog
+ dynamic="true"
+ modal="true"
+ resizable="false"
+ header="#{project.ADMIN_SINGLE_RECEIPT_DETAILS_HEADER}"
+ hideEffect="fade"
+ showEffect="fade"
+ widgetVar="receiptDialog"
+ position="center,center"
+ responsive="true"
+ >
+ <p:outputPanel id="receipt-details">
+ <p:panelGrid columns="2" rendered="#{not empty receiptListController.selectedReceipt}" columnClasses="label,value">
+ <f:facet name="header">
+ <h:outputFormat value="#{project.ADMIN_RECEIPT_DETAILS_HEADER}">
+ <f:param value="#{receiptListController.selectedReceipt.receiptId}" />
+ </h:outputFormat>
+ </f:facet>
+
+ <p:outputLabel value="#{msg.ID_NUMBER_HEADER}" title="#{project.RECEIPT_ID_NUMBER_TITLE}" />
+ <h:outputText value="#{receiptListController.selectedReceipt.receiptId}" />
+
+ <p:outputLabel value="#{project.RECEIPT_NUMBER}" title="#{project.RECEIPT_NUMBER_TITLE}" />
+ <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>
+
+ <p:outputLabel value="#{msg.BRANCH_OFFICE}" title="#{project.ASSIGNED_RECEIPT_BRANCH_OFFICE_TITLE}" />
+ <p:link outcome="admin_show_branch_office" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}" value="#{beanHelper.renderBranchOffice(receiptListController.selectedReceipt.receiptBranchOffice)}">
+ <f:param name="branchId" value="#{receiptListController.selectedReceipt.receiptBranchOffice.branchId}" />
+ </p:link>
+
+ <p:outputLabel value="#{project.SELLER_HEADER}" title="#{project.ASSIGNED_RECEIPT_SELLER_TITLE}" />
+ <p:link outcome="admin_show_employee" title="#{project.ADMIN_LINK_SHOW_RECEIPT_SELLER_EMPLOYEE_TITLE}" value="#{beanHelper.renderEmployee(receiptListController.selectedReceipt.receiptSellerEmployee)}" rendered="#{not empty receiptListController.selectedReceipt.receiptSellerEmployee}">
+ <f:param name="userId" value="#{receiptListController.selectedReceipt.receiptSellerEmployee.employeeId}" />
+ </p:link>
+ <h:outputText value="#{project.NO_SELLER_ASSIGNED_TO_RECEIPT}" rendered="#{empty receiptListController.selectedReceipt.receiptSellerEmployee}" />
+
+ <p:outputLabel value="#{msg.USER_HEADER}" title="#{project.ASSIGNED_RECEIPT_USER_TITLE}" />
+ <p:link outcome="admin_show_user" title="#{project.ADMIN_LINK_SHOW_RECEIPT_USER_EMPLOYEE_TITLE}" value="#{beanHelper.renderEmployee(receiptListController.selectedReceipt.receiptUser)}" rendered="#{not empty receiptListController.selectedReceipt.receiptUser}">
+ <f:param name="userId" value="#{receiptListController.selectedReceipt.receiptUser.userId}" />
+ </p:link>
+ <h:outputText value="#{project.NO_USER_ASSIGNED_TO_RECEIPT}" rendered="#{empty receiptListController.selectedReceipt.receiptUser}" />
+
+ <p:outputLabel value="#{project.RECEIPT_BARCODE_HEADER}" title="#{project.RECEIPT_BARCODE_TITLE}" />
+ <h:outputText value="#{receiptListController.selectedReceipt.receiptBarCodeNumber}" />
+
+ <p:outputLabel value="#{project.RECEIPT_SEQUENCE_NUMBER_HEADER}" title="#{project.RECEIPT_SEQUENCE_NUMBER_TITLE}" />
+ <h:outputText value="#{receiptListController.selectedReceipt.receiptSequenceNumber}" />
+
+ <p:outputLabel value="#{msg.PAYMENT_TYPE}" title="#{project.RECEIPT_PAYMENT_TYPE_TITLE}" />
+ <h:outputText value="#{msg[receiptListController.selectedReceipt.receiptPaymentType.i18nKey]}" />
+ </p:panelGrid>
+ </p:outputPanel>
+ </p:dialog>
</h:form>
<h:form>
type="submit"
value="#{project.BUTTON_ADMIN_ADD_RECEIPT}"
action="#{adminReceiptController.addReceipt()}"
- update=":master:form-list-financial-receipt:receiptList"
+ update=":master:form-list-financial-receipts:receiptList"
/>
</p:panelGrid>
</p:panelGrid>
title="#{project.FILTER_BY_MULTIPLE_RECEIPTS_TITLE}"
>
<f:converter converterId="ReceiptConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{receiptController.allReceipts()}" var="receipt" itemValue="#{receipt}" itemLabel="#{beanHelper.renderReceipt(receipt)}" />
+ <f:selectItems value="#{receiptListController.allReceipts}" var="receipt" itemValue="#{receipt}" itemLabel="#{beanHelper.renderReceipt(receipt)}" />
</p:selectCheckboxMenu>
</f:facet>
title="#{project.FILTER_BY_MULTIPLE_ITEM_PRODUCTS_TITLE}"
>
<f:converter converterId="GenericProductConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{productListController.allProducts}" var="product" itemValue="#{product}" itemLabel="#{beanHelper.renderGenericProduct(product)}" />
</p:selectCheckboxMenu>
</f:facet>
required="true"
requiredMessage="#{project.FIELD_FINANCIAL_INCOME_REQUIRED}"
>
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
<f:selectItems value="#{financialIncomeController.allIncomeIntervals()}" var="incomeInterval" itemValue="#{incomeInterval}" itemLabel="#{msg[incomeInterval.concat('_INTERVAL')]}" />
</p:selectOneMenu>
</div>