fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject incubator-fineract git commit: [BUG-17] Fixed issue with loan pre-closure
Date Fri, 06 May 2016 11:39:40 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop 318830fd4 -> d1067e5a8


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


Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/d1067e5a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/d1067e5a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/d1067e5a

Branch: refs/heads/develop
Commit: d1067e5a84ef61c1028afbbf8fc488a8b3c08893
Parents: 318830f
Author: Vishwa <vishwanath@confluxtechnologies.com>
Authored: Fri May 6 16:55:39 2016 +0530
Committer: Vishwa <vishwanath@confluxtechnologies.com>
Committed: Fri May 6 16:56:17 2016 +0530

----------------------------------------------------------------------
 .../apache/fineract/portfolio/loanaccount/domain/Loan.java    | 1 +
 .../portfolio/loanaccount/domain/LoanTransaction.java         | 5 +++++
 .../loanaccount/domain/LoanTransactionComparator.java         | 7 +++++++
 3 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/d1067e5a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
index 386f702..85725d2 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
@@ -3168,6 +3168,7 @@ public class Loan extends AbstractPersistable<Long> {
                 this.loanTransactions.add(finalAccrual);
             }
         }
+        updateLoanOutstandingBalaces();
     }
 
     private void determineCumulativeIncomeFromInstallments(HashMap<String, BigDecimal>
cumulativeIncomeFromInstallments) {

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/d1067e5a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
index 8172d0b..a97f8dd 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java
@@ -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();
     }

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/d1067e5a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionComparator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionComparator.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionComparator.java
index 44cf15f..fa18c88 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionComparator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionComparator.java
@@ -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());
             }


Mime
View raw message