commit for MIFOSX-2102 (Loan application submittedOnDate property compared with server date instead of tenant date)

This commit is contained in:
Emmanuel Nnaa
2015-07-06 10:40:12 +02:00
parent 1e00782c91
commit 9aacbb3178
@@ -1320,7 +1320,8 @@ public class Loan extends AbstractPersistable<Long> {
}
}
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());
}