MIFOSX-411: fix interest period determination for annual posting periods.

This commit is contained in:
Keith Woodlock
2013-06-11 14:16:17 +01:00
parent 106fc2d56d
commit f0ee892050
2 changed files with 4 additions and 4 deletions
@@ -183,7 +183,7 @@ public class SavingsAccountDataValidator {
if (this.fromApiJsonHelper.parameterExists(annualFeeAmountParamName, element)) {
final BigDecimal annualFeeAmount = fromApiJsonHelper.extractBigDecimalWithLocaleNamed(annualFeeAmountParamName, element);
baseDataValidator.reset().parameter(annualFeeAmountParamName).value(annualFeeAmount).notNull().positiveAmount();
baseDataValidator.reset().parameter(annualFeeAmountParamName).value(annualFeeAmount).positiveAmount();
if (annualFeeAmount != null) {
MonthDay monthDayOfAnnualFee = fromApiJsonHelper.extractMonthDayNamed(annualFeeOnMonthDayParamName, element);
@@ -621,7 +621,7 @@ public class SavingsAccount extends AbstractPersistable<Long> {
break;
case ANNUAL:
periodEndDate = periodStartDate.monthOfYear().withMaximumValue();
periodEndDate = periodStartDate.dayOfMonth().withMaximumValue();
periodEndDate = periodEndDate.dayOfMonth().withMaximumValue();
break;
}
@@ -680,11 +680,11 @@ public class SavingsAccount extends AbstractPersistable<Long> {
break;
case ANNUAL:
periodEndDate = periodStartDate.monthOfYear().withMaximumValue();
periodEndDate = periodStartDate.dayOfMonth().withMaximumValue();
periodEndDate = periodEndDate.dayOfMonth().withMaximumValue();
break;
case NO_COMPOUNDING_SIMPLE_INTEREST:
periodEndDate = periodStartDate.monthOfYear().withMaximumValue();
periodEndDate = periodStartDate.dayOfMonth().withMaximumValue();
periodEndDate = periodEndDate.dayOfMonth().withMaximumValue();
break;
}