@Test public void testShouldNotAddErrorIfTransactionDateAfterDisbursementDate() throws Exception { expect(paymentMock.getTransactionDate()).andReturn(DateUtils.currentDate()).anyTimes(); replay(paymentMock); ActionErrors errors = new ActionErrors(); form.validateTransactionDate(errors, paymentMock, DateUtils.getDateFromToday(-1)); verify(paymentMock); Assert.assertTrue(errors.isEmpty()); }
void validateTransactionDate(ActionErrors errors, PaymentDataHtmlBean template, java.util.Date disbursementDate) { if (template.hasTotalAmount()) { try { if (!DateUtils.dateFallsOnOrBeforeDate(template.getTransactionDate(), DateUtils.currentDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } else if (!DateUtils.dateFallsBeforeDate(disbursementDate, template.getTransactionDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATE, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATE)); } } catch (FrameworkRuntimeException ide) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } } }
LoanAccountActionForm extends BaseActionForm implements QuestionResponseCapturer, CashFlowCaptor { void validateTransactionDate(ActionErrors errors, PaymentDataHtmlBean template, java.util.Date disbursementDate) { if (template.hasTotalAmount()) { try { if (!DateUtils.dateFallsOnOrBeforeDate(template.getTransactionDate(), DateUtils.currentDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } else if (!DateUtils.dateFallsBeforeDate(disbursementDate, template.getTransactionDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATE, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATE)); } } catch (FrameworkRuntimeException ide) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } } } }
LoanAccountActionForm extends BaseActionForm implements QuestionResponseCapturer, CashFlowCaptor { void validateTransactionDate(ActionErrors errors, PaymentDataHtmlBean template, java.util.Date disbursementDate) { if (template.hasTotalAmount()) { try { if (!DateUtils.dateFallsOnOrBeforeDate(template.getTransactionDate(), DateUtils.currentDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } else if (!DateUtils.dateFallsBeforeDate(disbursementDate, template.getTransactionDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATE, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATE)); } } catch (FrameworkRuntimeException ide) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } } } LoanAccountActionForm(); }
LoanAccountActionForm extends BaseActionForm implements QuestionResponseCapturer, CashFlowCaptor { void validateTransactionDate(ActionErrors errors, PaymentDataHtmlBean template, java.util.Date disbursementDate) { if (template.hasTotalAmount()) { try { if (!DateUtils.dateFallsOnOrBeforeDate(template.getTransactionDate(), DateUtils.currentDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } else if (!DateUtils.dateFallsBeforeDate(disbursementDate, template.getTransactionDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATE, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATE)); } } catch (FrameworkRuntimeException ide) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } } } LoanAccountActionForm(); List<CashFlowDataDto> getCashflowDataDtos(); void setCashflowDataDtos(List<CashFlowDataDto> cashflowDataDtos); Date getOriginalDisbursementDate(); void setOriginalDisbursementDate(Date originalDisbursementDate); String getDayNumber(); void setDayNumber(String dayNumber); String getMonthRank(); void setMonthRank(String monthRank); String getMonthWeek(); void setMonthWeek(String monthWeek); String getMonthType(); void setMonthType(String monthType); String getMonthDay(); void setMonthDay(String monthDay); String getDayRecurMonth(); void setDayRecurMonth(String dayRecurMonth); String getRecurMonth(); void setRecurMonth(String recurMonth); String getRecurWeek(); void setRecurWeek(String recurWeek); String getFrequency(); void setFrequency(String frequency); String getWeekDay(); void setWeekDay(String weekDay); String getWeekRank(); void setWeekRank(String weekRank); String getRecurrenceId(); void setRecurrenceId(String recurrenceId); List<PaymentDataHtmlBean> getPaymentDataBeans(); String getGracePeriod(); void setGracePeriod(String gracePeriod); String getExternalId(); void setExternalId(String externalId); String getAccountId(); void setAccountId(String accountId); String getAccountName(); void setAccountName(String accountName); String getAccountTypeId(); void setAccountTypeId(String accountTypeId); String getCustomerId(); void setCustomerId(String customerId); String getGlobalAccountNum(); void setGlobalAccountNum(String globalAccountNum); String getPrdOfferingName(); void setPrdOfferingName(String prdOfferingName); String getPrdOfferingId(); void setPrdOfferingId(String prdOfferingId); String getBusinessActivityId(); void setBusinessActivityId(String businessActivityId); String getCollateralNote(); void setCollateralNote(String collateralNote); String getCollateralTypeId(); void setCollateralTypeId(String collateralTypeId); String getDisbursementDate(); String getScheduleViewDate(); void setDisbursementDate(String disbursementDate); void setScheduleViewDate(String scheduleViewDate); String getGracePeriodDuration(); void setGracePeriodDuration(String gracePeriodDuration); String getIntDedDisbursement(); void setIntDedDisbursement(String intDedDisbursement); String getInterestRate(); void setInterestRate(String interestRate); String getLoanAmount(); void setLoanAmount(String loanAmount); String getLoanOfferingFund(); void setLoanOfferingFund(String loanOfferingFund); String getNoOfInstallments(); void setNoOfInstallments(String noOfInstallments); List<CustomFieldDto> getCustomFields(); void setCustomFields(List<CustomFieldDto> customFields); CustomFieldDto getCustomField(int i); List<FeeDto> getAdditionalFees(); void setAdditionalFees(List<FeeDto> additionalFees); List<FeeDto> getDefaultFees(); void setDefaultFees(List<FeeDto> defaultFees); String getStateSelected(); void setStateSelected(String stateSelected); AccountState getState(); Integer getCustomerIdValue(); Short getPrdOfferingIdValue(); Short getGracePeriodDurationValue(); Short getNoOfInstallmentsValue(); Date getDisbursementDateValue(Locale locale); Date getScheduleViewDateValue(Locale locale); Date getFirstRepaymentDayValue(Locale locale); boolean isInterestDedAtDisbValue(); Double getInterestDoubleValue(); Short getLoanOfferingFundValue(); Integer getBusinessActivityIdValue(); Integer getCollateralTypeIdValue(); FeeDto getDefaultFee(int i); Boolean isInterestDeductedAtDisbursement(); void initializeTransactionFields(List<PaymentDataHtmlBean> paymentDataBeans); List<FeeDto> getFeesToApply(); boolean isDefaultFeeRemoved(); FeeDto getSelectedFee(int index); @Override void reset(ActionMapping mapping, HttpServletRequest request); @Override ActionErrors validate(ActionMapping mapping, HttpServletRequest request); boolean isAmountZeroOrNull(String loanAmount); String getPerspective(); void setPerspective(String perspective); List<String> getClients(); void setClients(List<String> clients); String getClients(int i); void setClients(int i, String string); List<LoanAccountDetailsDto> getClientDetails(); void setClientDetails(List<LoanAccountDetailsDto> clientDetails); String getFirstRepaymentDay(); void setFirstRepaymentDay(String firstRepaymentDay); void setLoanAmountRange(AmountRange amountRange); void setMaxInterestRate(Double maxInterestRate); void setMinInterestRate(Double minInterestRate); void setInstallmentRange(InstallmentRange installmentRange); String getMinInterestRate(); Double getMinInterestRateValue(); String getMaxInterestRate(); Double getMaxInterestRateValue(); String getMinLoanAmount(); Double getMinLoanAmountValue(); String getMaxLoanAmount(); Double getMaxLoanAmountValue(); String getMinNoInstallments(); Short getMinNoInstallmentsValue(); String getMaxNoInstallments(); Short getMaxNoInstallmentsValue(); void removeClientDetailsWithNoMatchingClients(); void initializeInstallments(List<RepaymentScheduleInstallment> installments); BigDecimal getLoanAmountAsBigDecimal(); void resetScheduleViewDate(); List<FeeDto> getApplicableFees(); void clearDetailsForLoan(); @Override void setQuestionGroups(List<QuestionGroupDetail> questionGroups); @Override List<QuestionGroupDetail> getQuestionGroups(); List<RepaymentScheduleInstallment> getInstallments(); boolean isVariableInstallmentsAllowed(); void setVariableInstallmentsAllowed(boolean variableInstallmentsAllowed); void setMinimumGapInDays(Integer minimumGapInDays); Integer getMinimumGapInDays(); Integer getMaximumGapInDays(); void setMaximumGapInDays(Integer maximumGapInDays); Money getMinInstallmentAmount(); void setMinInstallmentAmount(Money minInstallmentAmount); @Override CashFlowForm getCashFlowForm(); @Override void setCashFlowForm(CashFlowForm cashFlowForm); Money getLoanAmountValue(); }
LoanAccountActionForm extends BaseActionForm implements QuestionResponseCapturer, CashFlowCaptor { void validateTransactionDate(ActionErrors errors, PaymentDataHtmlBean template, java.util.Date disbursementDate) { if (template.hasTotalAmount()) { try { if (!DateUtils.dateFallsOnOrBeforeDate(template.getTransactionDate(), DateUtils.currentDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } else if (!DateUtils.dateFallsBeforeDate(disbursementDate, template.getTransactionDate())) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATE, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATE)); } } catch (FrameworkRuntimeException ide) { errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT, new ActionMessage( LoanExceptionConstants.INVALIDTRANSACTIONDATEFORPAYMENT)); } } } LoanAccountActionForm(); List<CashFlowDataDto> getCashflowDataDtos(); void setCashflowDataDtos(List<CashFlowDataDto> cashflowDataDtos); Date getOriginalDisbursementDate(); void setOriginalDisbursementDate(Date originalDisbursementDate); String getDayNumber(); void setDayNumber(String dayNumber); String getMonthRank(); void setMonthRank(String monthRank); String getMonthWeek(); void setMonthWeek(String monthWeek); String getMonthType(); void setMonthType(String monthType); String getMonthDay(); void setMonthDay(String monthDay); String getDayRecurMonth(); void setDayRecurMonth(String dayRecurMonth); String getRecurMonth(); void setRecurMonth(String recurMonth); String getRecurWeek(); void setRecurWeek(String recurWeek); String getFrequency(); void setFrequency(String frequency); String getWeekDay(); void setWeekDay(String weekDay); String getWeekRank(); void setWeekRank(String weekRank); String getRecurrenceId(); void setRecurrenceId(String recurrenceId); List<PaymentDataHtmlBean> getPaymentDataBeans(); String getGracePeriod(); void setGracePeriod(String gracePeriod); String getExternalId(); void setExternalId(String externalId); String getAccountId(); void setAccountId(String accountId); String getAccountName(); void setAccountName(String accountName); String getAccountTypeId(); void setAccountTypeId(String accountTypeId); String getCustomerId(); void setCustomerId(String customerId); String getGlobalAccountNum(); void setGlobalAccountNum(String globalAccountNum); String getPrdOfferingName(); void setPrdOfferingName(String prdOfferingName); String getPrdOfferingId(); void setPrdOfferingId(String prdOfferingId); String getBusinessActivityId(); void setBusinessActivityId(String businessActivityId); String getCollateralNote(); void setCollateralNote(String collateralNote); String getCollateralTypeId(); void setCollateralTypeId(String collateralTypeId); String getDisbursementDate(); String getScheduleViewDate(); void setDisbursementDate(String disbursementDate); void setScheduleViewDate(String scheduleViewDate); String getGracePeriodDuration(); void setGracePeriodDuration(String gracePeriodDuration); String getIntDedDisbursement(); void setIntDedDisbursement(String intDedDisbursement); String getInterestRate(); void setInterestRate(String interestRate); String getLoanAmount(); void setLoanAmount(String loanAmount); String getLoanOfferingFund(); void setLoanOfferingFund(String loanOfferingFund); String getNoOfInstallments(); void setNoOfInstallments(String noOfInstallments); List<CustomFieldDto> getCustomFields(); void setCustomFields(List<CustomFieldDto> customFields); CustomFieldDto getCustomField(int i); List<FeeDto> getAdditionalFees(); void setAdditionalFees(List<FeeDto> additionalFees); List<FeeDto> getDefaultFees(); void setDefaultFees(List<FeeDto> defaultFees); String getStateSelected(); void setStateSelected(String stateSelected); AccountState getState(); Integer getCustomerIdValue(); Short getPrdOfferingIdValue(); Short getGracePeriodDurationValue(); Short getNoOfInstallmentsValue(); Date getDisbursementDateValue(Locale locale); Date getScheduleViewDateValue(Locale locale); Date getFirstRepaymentDayValue(Locale locale); boolean isInterestDedAtDisbValue(); Double getInterestDoubleValue(); Short getLoanOfferingFundValue(); Integer getBusinessActivityIdValue(); Integer getCollateralTypeIdValue(); FeeDto getDefaultFee(int i); Boolean isInterestDeductedAtDisbursement(); void initializeTransactionFields(List<PaymentDataHtmlBean> paymentDataBeans); List<FeeDto> getFeesToApply(); boolean isDefaultFeeRemoved(); FeeDto getSelectedFee(int index); @Override void reset(ActionMapping mapping, HttpServletRequest request); @Override ActionErrors validate(ActionMapping mapping, HttpServletRequest request); boolean isAmountZeroOrNull(String loanAmount); String getPerspective(); void setPerspective(String perspective); List<String> getClients(); void setClients(List<String> clients); String getClients(int i); void setClients(int i, String string); List<LoanAccountDetailsDto> getClientDetails(); void setClientDetails(List<LoanAccountDetailsDto> clientDetails); String getFirstRepaymentDay(); void setFirstRepaymentDay(String firstRepaymentDay); void setLoanAmountRange(AmountRange amountRange); void setMaxInterestRate(Double maxInterestRate); void setMinInterestRate(Double minInterestRate); void setInstallmentRange(InstallmentRange installmentRange); String getMinInterestRate(); Double getMinInterestRateValue(); String getMaxInterestRate(); Double getMaxInterestRateValue(); String getMinLoanAmount(); Double getMinLoanAmountValue(); String getMaxLoanAmount(); Double getMaxLoanAmountValue(); String getMinNoInstallments(); Short getMinNoInstallmentsValue(); String getMaxNoInstallments(); Short getMaxNoInstallmentsValue(); void removeClientDetailsWithNoMatchingClients(); void initializeInstallments(List<RepaymentScheduleInstallment> installments); BigDecimal getLoanAmountAsBigDecimal(); void resetScheduleViewDate(); List<FeeDto> getApplicableFees(); void clearDetailsForLoan(); @Override void setQuestionGroups(List<QuestionGroupDetail> questionGroups); @Override List<QuestionGroupDetail> getQuestionGroups(); List<RepaymentScheduleInstallment> getInstallments(); boolean isVariableInstallmentsAllowed(); void setVariableInstallmentsAllowed(boolean variableInstallmentsAllowed); void setMinimumGapInDays(Integer minimumGapInDays); Integer getMinimumGapInDays(); Integer getMaximumGapInDays(); void setMaximumGapInDays(Integer maximumGapInDays); Money getMinInstallmentAmount(); void setMinInstallmentAmount(Money minInstallmentAmount); @Override CashFlowForm getCashFlowForm(); @Override void setCashFlowForm(CashFlowForm cashFlowForm); Money getLoanAmountValue();  }