added condition to change the year

This commit is contained in:
Pramod Nuthakki
2013-09-03 10:49:34 +05:30
parent 5d4b6f8f72
commit 482c1fe677
@@ -842,7 +842,10 @@ public class SavingsAccount extends AbstractPersistable<Long> {
} }
private void updateToNextAnnualFeeDueDateFrom(final LocalDate startingDate) { 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(); this.annualFeeNextDueDate = nextDueLocalDate.toDate();
} }