MIFOSX-1162 : removed overdue loan charge on undo disburse
This commit is contained in:
+5
-1
@@ -2118,7 +2118,11 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
this.actualDisbursementDate = null;
|
||||
|
||||
for (final LoanCharge charge : charges()) {
|
||||
charge.resetToOriginal(loanCurrency());
|
||||
if (charge.isOverdueInstallmentCharge()) {
|
||||
charge.setActive(false);
|
||||
} else {
|
||||
charge.resetToOriginal(loanCurrency());
|
||||
}
|
||||
}
|
||||
|
||||
for (final LoanRepaymentScheduleInstallment currentInstallment : this.repaymentScheduleInstallments) {
|
||||
|
||||
+4
-1
@@ -305,7 +305,7 @@ public class LoanCharge extends AbstractPersistable<Long> {
|
||||
this.paid = false;
|
||||
this.waived = false;
|
||||
for (final LoanInstallmentCharge installmentCharge : this.loanInstallmentCharge) {
|
||||
installmentCharge.resetPaidAmount(currency);
|
||||
installmentCharge.resetToOriginal(currency);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -816,6 +816,9 @@ public class LoanCharge extends AbstractPersistable<Long> {
|
||||
|
||||
public void setActive(boolean active) {
|
||||
this.active = active;
|
||||
if (!active) {
|
||||
this.overdueInstallmentCharge = null;
|
||||
}
|
||||
}
|
||||
|
||||
public BigDecimal amountOrPercentage() {
|
||||
|
||||
Reference in New Issue
Block a user