Search in sources :

Example 41 with ErrorEntry

use of org.mifos.platform.validations.ErrorEntry in project head by mifos.

the class CashFlowSummaryFormBean method prevalidateDueDateIsNonNull.

@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "DLS_DEAD_LOCAL_STORE" }, justification = "")
private void prevalidateDueDateIsNonNull(MessageContext messageContext) {
    Integer installmentIndex = 1;
    for (DateTime dueDate : this.installments) {
        if (dueDate == null) {
            String defaultMessage = "The due date field for installment {0} is blank.";
            ErrorEntry fieldError = new ErrorEntry("installment.duedate.blank.and.invalid", "installmentAmounts", defaultMessage);
            fieldError.setArgs(Arrays.asList(installmentIndex.toString()));
            addErrorMessageToContext(messageContext, fieldError);
        }
        installmentIndex++;
    }
}
Also used : ErrorEntry(org.mifos.platform.validations.ErrorEntry) DateTime(org.joda.time.DateTime)

Example 42 with ErrorEntry

use of org.mifos.platform.validations.ErrorEntry in project head by mifos.

the class LoanScheduleFormBean method prevalidateActualPaymentDateIsNonNull.

@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "DLS_DEAD_LOCAL_STORE" }, justification = "")
private void prevalidateActualPaymentDateIsNonNull(MessageContext messageContext) {
    Integer installmentIndex = 1;
    for (DateTime dueDate : this.actualPaymentDates) {
        if (dueDate == null) {
            String defaultMessage = "The actual payment date field for installment {0} is blank.";
            ErrorEntry fieldError = new ErrorEntry("installment.actualpaymentdate.blank.and.invalid", "installmentAmounts", defaultMessage);
            fieldError.setArgs(Arrays.asList(installmentIndex.toString()));
            addErrorMessageToContext(messageContext, fieldError);
        }
        installmentIndex++;
    }
}
Also used : ErrorEntry(org.mifos.platform.validations.ErrorEntry) DateTime(org.joda.time.DateTime)

Aggregations

ErrorEntry (org.mifos.platform.validations.ErrorEntry)42 RepaymentScheduleInstallment (org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment)19 Test (org.junit.Test)17 Date (java.util.Date)14 ArrayList (java.util.ArrayList)8 Money (org.mifos.framework.util.helpers.Money)8 DateTime (org.joda.time.DateTime)6 LocalDate (org.joda.time.LocalDate)6 VariableInstallmentDetailsBO (org.mifos.accounts.productdefinition.business.VariableInstallmentDetailsBO)5 BigDecimal (java.math.BigDecimal)4 Errors (org.mifos.platform.validations.Errors)4 Calendar (java.util.Calendar)2 LoanCreationProductDetailsDto (org.mifos.dto.screen.LoanCreationProductDetailsDto)2 MessageBuilder (org.springframework.binding.message.MessageBuilder)2 MessageContext (org.springframework.binding.message.MessageContext)2 HSSFRichTextString (org.apache.poi.hssf.usermodel.HSSFRichTextString)1 ActionErrors (org.apache.struts.action.ActionErrors)1 ActionMessage (org.apache.struts.action.ActionMessage)1 VariableInstallmentWithFeeValidationResult (org.mifos.clientportfolio.newloan.applicationservice.VariableInstallmentWithFeeValidationResult)1 CustomerBO (org.mifos.customers.business.CustomerBO)1