From 482c1fe6778f98178fc86e285c79e26b10d73ecb Mon Sep 17 00:00:00 2001 From: Pramod Nuthakki Date: Tue, 3 Sep 2013 10:49:34 +0530 Subject: [PATCH] added condition to change the year --- .../portfolio/savings/domain/SavingsAccount.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java index 2537667d9..ee4c6d4e1 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java @@ -842,7 +842,10 @@ public class SavingsAccount extends AbstractPersistable { } private void updateToNextAnnualFeeDueDateFrom(final LocalDate startingDate) { - final LocalDate nextDueLocalDate = startingDate.withMonthOfYear(this.annualFeeOnMonth).withDayOfMonth(this.annualFeeOnDay); + LocalDate nextDueLocalDate = startingDate.withMonthOfYear(this.annualFeeOnMonth).withDayOfMonth(this.annualFeeOnDay); + if (startingDate.isAfter(nextDueLocalDate)) { + nextDueLocalDate = nextDueLocalDate.plusYears(1); + } this.annualFeeNextDueDate = nextDueLocalDate.toDate(); }