MIFOSX-1841
This commit is contained in:
+6
-8
@@ -708,6 +708,11 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
|
|||||||
|
|
||||||
public void updateToNextDueDateFrom(final LocalDate startingDate) {
|
public void updateToNextDueDateFrom(final LocalDate startingDate) {
|
||||||
if (isAnnualFee() || isMonthlyFee() || isWeeklyFee()) {
|
if (isAnnualFee() || isMonthlyFee() || isWeeklyFee()) {
|
||||||
|
this.dueDate = getNextDueDateFrom(startingDate).toDate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getNextDueDateFrom(final LocalDate startingDate) {
|
||||||
LocalDate nextDueLocalDate = null;
|
LocalDate nextDueLocalDate = null;
|
||||||
if (isAnnualFee() || isMonthlyFee()) {
|
if (isAnnualFee() || isMonthlyFee()) {
|
||||||
nextDueLocalDate = startingDate.withMonthOfYear(this.feeOnMonth);
|
nextDueLocalDate = startingDate.withMonthOfYear(this.feeOnMonth);
|
||||||
@@ -723,10 +728,7 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
|
|||||||
} else {
|
} else {
|
||||||
nextDueLocalDate = calculateNextDueDate(startingDate);
|
nextDueLocalDate = calculateNextDueDate(startingDate);
|
||||||
}
|
}
|
||||||
|
return nextDueLocalDate;
|
||||||
this.dueDate = nextDueLocalDate.toDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private LocalDate calculateNextDueDate(final LocalDate date) {
|
private LocalDate calculateNextDueDate(final LocalDate date) {
|
||||||
@@ -809,10 +811,6 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
|
|||||||
return this.amountPaid;
|
return this.amountPaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalDate nextDuDate(final LocalDate date) {
|
|
||||||
return calculateNextDueDate(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void inactiavateCharge(final LocalDate inactivationOnDate) {
|
public void inactiavateCharge(final LocalDate inactivationOnDate) {
|
||||||
this.inactivationDate = inactivationOnDate.toDate();
|
this.inactivationDate = inactivationOnDate.toDate();
|
||||||
this.status = false;
|
this.status = false;
|
||||||
|
|||||||
+1
-1
@@ -1052,7 +1052,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
final LocalDate nextDueDate = savingsAccountCharge.nextDuDate(inactivationOnDate);
|
final LocalDate nextDueDate = savingsAccountCharge.getNextDueDateFrom(inactivationOnDate);
|
||||||
|
|
||||||
if (savingsAccountCharge.isChargeIsDue(nextDueDate)) {
|
if (savingsAccountCharge.isChargeIsDue(nextDueDate)) {
|
||||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("inactivation.of.charge.not.allowed.when.charge.is.due");
|
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("inactivation.of.charge.not.allowed.when.charge.is.due");
|
||||||
|
|||||||
Reference in New Issue
Block a user