MIFOSX-1162 : removed overdue loan charge on undo disburse

This commit is contained in:
Pramod Nuthakki
2014-05-03 01:07:01 +05:30
parent 78c0761ae5
commit 29478ca023
4 changed files with 15 additions and 3 deletions
@@ -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) {
@@ -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() {