[BUG-17] Fixed issue with loan pre-closure
This commit is contained in:
+1
@@ -3168,6 +3168,7 @@ public class Loan extends AbstractPersistable<Long> {
|
||||
this.loanTransactions.add(finalAccrual);
|
||||
}
|
||||
}
|
||||
updateLoanOutstandingBalaces();
|
||||
}
|
||||
|
||||
private void determineCumulativeIncomeFromInstallments(HashMap<String, BigDecimal> cumulativeIncomeFromInstallments) {
|
||||
|
||||
+5
@@ -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();
|
||||
}
|
||||
|
||||
+7
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user