From 01f27d6ffab7da58f36f173c9700784e1ee594d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 30 Apr 2020 23:41:37 +0200 Subject: [PATCH] Don't cherry-pick: - renamed class field financialBean to financialIncomeBean as this reflects the real purpose of the EJB. - exposed incomeEnabled flag in admin-add-income form - removed some needless tags as it can be done easier in PrimeFaces - added missing i18n strings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../FinancialsIncomeWebRequestBean.java | 35 +++++- .../localization/project_de_DE.properties | 5 + .../localization/project_en_US.properties | 3 + .../login_financials_add_income.xhtml | 114 +++++++++--------- 4 files changed, 94 insertions(+), 63 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/income/FinancialsIncomeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/income/FinancialsIncomeWebRequestBean.java index eee3e863..a8fd8939 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/income/FinancialsIncomeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/income/FinancialsIncomeWebRequestBean.java @@ -49,7 +49,12 @@ public class FinancialsIncomeWebRequestBean extends BaseFinancialsBean implement * EJB for general financial income purposes */ @EJB (lookup = "java:global/jfinancials-ejb/financialIncome!org.mxchange.jfinancials.model.income.FinancialIncomeSessionBeanRemote") - private FinancialIncomeSessionBeanRemote financialBean; + private FinancialIncomeSessionBeanRemote financialIncomeBean; + + /** + * Whether the income is enabled + */ + private Boolean incomeEnabled; /** * Income interval @@ -106,11 +111,17 @@ public class FinancialsIncomeWebRequestBean extends BaseFinancialsBean implement } // Now that all required data has been entered, prepare new income instance - final BillableIncome income = new FinancialIncome(this.getIncomeTitle(), this.getIncomeSingleAmount(), this.getIncomeInterval(), this.userLoginController.getLoggedInUser()); + final BillableIncome income = new FinancialIncome( + this.getIncomeTitle(), + this.getIncomeSingleAmount(), + this.getIncomeInterval(), + this.userLoginController.getLoggedInUser(), + this.getIncomeEnabled() + ); // Handle it over to the EJB // @TODO Use updated income instance, e.g. fire event - final BillableIncome updatedIncome = this.financialBean.addIncome(income); + final BillableIncome updatedIncome = this.financialIncomeBean.addIncome(income); } /** @@ -123,6 +134,24 @@ public class FinancialsIncomeWebRequestBean extends BaseFinancialsBean implement return Arrays.asList(FinancialInterval.values()); } + /** + * Getter for incomeEnabled flag + *

+ * @return incomeEnabled flag + */ + public Boolean getIncomeEnabled () { + return this.incomeEnabled; + } + + /** + * Setter for incomeEnabled flag + *

+ * @param incomeEnabled incomeEnabled flag + */ + public void setIncomeEnabled (final Boolean incomeEnabled) { + this.incomeEnabled = incomeEnabled; + } + /** * Getter for income interval *

diff --git a/src/java/org/mxchange/localization/project_de_DE.properties b/src/java/org/mxchange/localization/project_de_DE.properties index b55de5ed..dc6379b1 100644 --- a/src/java/org/mxchange/localization/project_de_DE.properties +++ b/src/java/org/mxchange/localization/project_de_DE.properties @@ -192,3 +192,8 @@ BUTTON_ADMIN_EDIT_RECEIPT_ITEM=Kassenboneintrag aendern RECEIPT_ITEM_UPDATED_TITLE=Wann dieser Kassenboneintrag als letztes geaendert wurde. #@TODO Please fix German umlauts! ADMIN_ERROR_FINANCIAL_RECEIPT_ITEM_NOT_CHANGED=Fehler: Sie haben den Kassenboneintrag nicht geaendert. +#@TODO Please fix German umlauts! +ADMIN_ENABLE_INCOME_REQUIRED=Sie muessen entweder das Einkommen aktivieren oder deaktivieren. +ADMIN_ENABLE_INCOME=Einkommen aktiviert? +#@TODO Please fix German umlauts! +ADMIN_ENABLE_INCOME_TITLE=Bitte waehlen Sie aus, ob das Einkommen aktiviert ist. diff --git a/src/java/org/mxchange/localization/project_en_US.properties b/src/java/org/mxchange/localization/project_en_US.properties index 1140fa17..d9bf44d2 100644 --- a/src/java/org/mxchange/localization/project_en_US.properties +++ b/src/java/org/mxchange/localization/project_en_US.properties @@ -159,3 +159,6 @@ ADMIN_EDIT_RECEIPT_ITEM_MINIMUM_DATA=Enter minimum data, marked with (*) for thi BUTTON_ADMIN_EDIT_RECEIPT_ITEM=Change receipt item RECEIPT_ITEM_UPDATED_TITLE=Then this receipt item has been recently updated. ADMIN_ERROR_FINANCIAL_RECEIPT_ITEM_NOT_CHANGED=Error: You did not change the receipt item. +ADMIN_ENABLE_INCOME_REQUIRED=You have to whether enable or disabled the income. +ADMIN_ENABLE_INCOME=Income enabled? +ADMIN_ENABLE_INCOME_TITLE=Please choose whether the income is enabled. diff --git a/web/user/financials/login_financials_add_income.xhtml b/web/user/financials/login_financials_add_income.xhtml index 3f4777ce..f827e87c 100644 --- a/web/user/financials/login_financials_add_income.xhtml +++ b/web/user/financials/login_financials_add_income.xhtml @@ -18,72 +18,66 @@ - -

- -
- - -
- -
+ + + -
- - - -
-
+ + + + + - -
- -
+ + + + -
- - - -
-
+ + + + - -
- -
+ + +
-
- - - -
- + + - - - - - - + + -- 2.39.5