[BUG-17] Fixed issue with loan pre-closure

This commit is contained in:
Vishwa
2016-05-06 16:56:17 +05:30
parent 318830fd45
commit d1067e5a84
3 changed files with 13 additions and 0 deletions
@@ -3168,6 +3168,7 @@ public class Loan extends AbstractPersistable<Long> {
this.loanTransactions.add(finalAccrual);
}
}
updateLoanOutstandingBalaces();
}
private void determineCumulativeIncomeFromInstallments(HashMap<String, BigDecimal> cumulativeIncomeFromInstallments) {
@@ -490,6 +490,11 @@ public final class LoanTransaction extends AbstractPersistable<Long> {
public boolean isIncomePosting() {
return LoanTransactionType.INCOME_POSTING.equals(getTypeOf()) && isNotReversed();
}
public boolean isNotIncomePosting() {
return !isIncomePosting();
}
public boolean isDisbursement() {
return LoanTransactionType.DISBURSEMENT.equals(getTypeOf()) && isNotReversed();
}
@@ -37,6 +37,13 @@ public class LoanTransactionComparator implements Comparator<LoanTransaction> {
**/
if (comparsion == 0) {
int comparisonBasedOnCreatedDate = 0;
if (o1.isIncomePosting() && o2.isNotIncomePosting()) {
compareResult = -1;
} else if (o1.isNotIncomePosting() && o2.isIncomePosting()) {
compareResult = 1;
} else {
compareResult = 0;
}
if (o1.getCreatedDateTime() != null && o2.getCreatedDateTime() != null) {
comparisonBasedOnCreatedDate = o1.getCreatedDateTime().compareTo(o2.getCreatedDateTime());
}