]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 8 Jun 2017 21:10:56 +0000 (23:10 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 8 Jun 2017 21:12:53 +0000 (23:12 +0200)
- receipt's date of issue should be entered so the user can have a detailed track
- A receipt number is required for persisting, the user can leave it empty so a
  random number is generated. But then the user must be careful not to add same
  receipt twice.
- fixed copyrights, no email address here

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java
src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionController.java
src/java/org/mxchange/jfinancials/beans/financial/income/FinancialsIncomeWebRequestController.java
src/java/org/mxchange/jfinancials/converter/contact/FinancialsContactConverter.java
web/user/financials/login_financials_add_receipt.xhtml

index b7d84b406d17dcd29514a2c0729241e1abbdf101..256832ca47649042cccbeb6b23fa5c8dd8b2b436 100644 (file)
@@ -39,7 +39,7 @@ import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcontacts.contact.utils.ContactUtils;
 import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
 import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
-import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
+import org.mxchange.jcontactsbusiness.exceptions.BusinessContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsController;
 import org.mxchange.jfinancials.beans.login.user.FinancialsUserLoginWebSessionController;
@@ -931,7 +931,7 @@ public class FinancialsContactWebSessionBean extends BaseFinancialsController im
        }
 
        @Override
-       public Contact lookupContactById (final Long contactId) throws ContactNotFoundException {
+       public Contact lookupContactById (final Long contactId) throws BusinessContactNotFoundException {
                // Init variable
                Contact localContact = null;
 
@@ -954,7 +954,7 @@ public class FinancialsContactWebSessionBean extends BaseFinancialsController im
                // Is it still null?
                if (null == localContact) {
                        // Not visible for the current user
-                       throw new ContactNotFoundException(contactId);
+                       throw new BusinessContactNotFoundException(contactId);
                }
 
                // Copy all data to this bean
index ec63e3afe3c3a64db7c8ee6a17c4f43944aff72f..59ed155d11dda206f40557f7db1aee62036d008d 100644 (file)
@@ -22,7 +22,7 @@ import java.util.List;
 import javax.ejb.Local;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.gender.Gender;
-import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
+import org.mxchange.jcontactsbusiness.exceptions.BusinessContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
@@ -61,9 +61,9 @@ public interface FinancialsContactWebSessionController extends Serializable {
         * <p>
         * @return Contact instance
         * <p>
-        * @throws ContactNotFoundException If the user is not found
+        * @throws BusinessContactNotFoundException If the user is not found
         */
-       Contact lookupContactById (final Long contactId) throws ContactNotFoundException;
+       Contact lookupContactById (final Long contactId) throws BusinessContactNotFoundException;
 
        /**
         * Creates an instance from all properties
index e25f954eb149864534eefde3622fdb03a27acbd0..07eec5e2c99d20ee01bf9b698fb6476c1bb4abd1 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jfinancials.beans.financial.income;
 
 import java.io.Serializable;
 import java.util.List;
+import javax.ejb.Local;
 import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
 
 /**
@@ -25,6 +26,7 @@ import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
+@Local
 public interface FinancialsIncomeWebRequestController extends Serializable {
 
        /**
index cd62e99ba0eb61395265547c004452f31d1fdeec..e8d1535c405970bb22b1da230c87f934c95fdcb9 100644 (file)
@@ -38,7 +38,7 @@ import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 public class FinancialsContactConverter implements Converter {
 
        /**
-        * User EJB
+        * Contact EJB
         */
        private ContactSessionBeanRemote contactBean;
 
index 1a0e88eeb88410b6ee0934feb64ffde3ba30af94..341259fc1143b19757756c1ea340866d57ae800c 100644 (file)
@@ -29,9 +29,9 @@
                                                </div>
 
                                                <div class="table_right_medium">
-                                                       <h:selectOneMenu styleClass="select" id="receiptCompany" value="#{financialReceiptController.incomeInterval}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_RECEIPT_COMPANY_REQUIRED}">
+                                                       <h:selectOneMenu styleClass="select" id="receiptCompany" value="#{financialReceiptController.receiptCompany}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_RECEIPT_COMPANY_REQUIRED}" converter="BusinessContactConverter">
                                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
-                                                               <f:selectItems value="#{financialReceiptController.allRegisteredCompanies()}" var="receiptCompany" itemValue="#{receiptCompany}" itemLabel="#{receiptCompany.someFoo}" />
+                                                               <f:selectItems value="#{businessContactController.allRegisteredCompanies()}" var="receiptCompany" itemValue="#{receiptCompany}" itemLabel="#{receiptCompany.basicBusinessData.companyName}" />
                                                        </h:selectOneMenu>
                                                </div>
 
 
                                        <div class="table_row">
                                                <div class="table_left_medium">
-                                                       <h:outputLabel for="receiptCreated" value="#{msg.LOGIN_FINANCIAL_ENTER_RECEIPT_CREATED}" />
+                                                       <h:outputLabel for="receiptIssued" value="#{msg.LOGIN_FINANCIAL_ENTER_RECEIPT_CREATED}" />
                                                </div>
 
                                                <div class="table_right_medium">
-                                                       <p:calendar id="receiptCreated" locale="#{localizationController.locale.displayCountry}" value="#{financialReceiptController.receiptCreated}" />
+                                                       <p:calendar id="receiptIssued" locale="#{localizationController.locale.displayCountry}" value="#{financialReceiptController.receiptIssued}" />
+                                               </div>
+
+                                               <div class="clear"></div>
+                                       </div>
+
+                                       <div class="table_row">
+                                               <div class="table_left_medium">
+                                                       <h:outputLabel for="receiptNumber" value="#{msg.LOGIN_FINANCIAL_RECEIPT_NUMBER}" />
+                                               </div>
+
+                                               <div class="table_right_medium">
+                                                       <h:inputText styleClass="input" id="receiptNumber" size="2" maxlength="10" value="#{financialReceiptController.receiptNumber}" validatorMessage="#{msg.ENTERED_RECEIPT_NUMBER_INVALID}">
+                                                               <f:validateLongRange minimum="1" maximum="20" />
+                                                       </h:inputText>
                                                </div>
 
                                                <div class="clear"></div>
                                        <div class="table_row">
                                                <h:outputText value="#{msg.LOGIN_FINANCIAL_COMPANY_NOT_FOUND}" />
                                                <h:outputText value="&nbsp;" />
-                                               <p:link title="#{msg.LINK_LOGIN_FINANCIAL_ADD_COMPANY_TITLE}" outcome="login_add_receipt_company" value="#{msg.LINK_LOGIN_FINANCIAL_ADD_COMPANY}" />
+                                               <h:link title="#{msg.LINK_LOGIN_FINANCIAL_ADD_COMPANY_TITLE}" outcome="login_add_receipt_company" value="#{msg.LINK_LOGIN_FINANCIAL_ADD_COMPANY}" />
+                                       </div>
+
+                                       <div class="table_row">
+                                               <div class="table_left_medium">
+                                                       <h:outputLabel for="paymentType" value="#{msg.LOGIN_FINANCIAL_INCOME_INTERVAL}" />
+                                               </div>
+
+                                               <div class="table_right_medium">
+                                                       <h:selectOneMenu styleClass="select" id="paymentType" value="#{financialReceiptController.paymentType}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_INCOME_REQUIRED}">
+                                                               <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
+                                                               <f:selectItems value="#{financialReceiptController.allPaymentTypes()}" var="paymentType" itemValue="#{paymentType}" itemLabel="#{msg[paymentType]}" />
+                                                       </h:selectOneMenu>
+                                               </div>
+
+                                               <div class="clear"></div>
                                        </div>
 
                                        <div class="table_footer">