From 9aacbb3178aa64b5573ad2e571cfaa41df8ae3df Mon Sep 17 00:00:00 2001 From: Emmanuel Nnaa Date: Mon, 6 Jul 2015 10:40:12 +0200 Subject: [PATCH] commit for MIFOSX-2102 (Loan application submittedOnDate property compared with server date instead of tenant date) --- .../org/mifosplatform/portfolio/loanaccount/domain/Loan.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java index 845f9632f..29098e44d 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java @@ -1320,7 +1320,8 @@ public class Loan extends AbstractPersistable { } } - if (getSubmittedOnDate().isAfter(new LocalDate())) { + // the comparison should be done with the tenant date (DateUtils.getLocalDateOfTenant()) and not the server date (new LocalDate()) + if (getSubmittedOnDate().isAfter(DateUtils.getLocalDateOfTenant())) { final String errorMessage = "The date on which a loan is submitted cannot be in the future."; throw new InvalidLoanStateTransitionException("submittal", "cannot.be.a.future.date", errorMessage, getSubmittedOnDate()); }