fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [1/3] incubator-fineract git commit: [BUG-347] Stop interest posting once the loan has moved to overpaid state
Date Fri, 06 May 2016 11:23:43 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop 401cad4d3 -> 318830fd4


[BUG-347] Stop interest posting once the loan has moved to overpaid state


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

Branch: refs/heads/develop
Commit: e7fbec05be0061e17aeb3f5695c2d97cb4df55a7
Parents: 401cad4
Author: Vishwa <vishwanath@confluxtechnologies.com>
Authored: Thu May 5 18:28:57 2016 +0530
Committer: Vishwa <vishwanath@confluxtechnologies.com>
Committed: Thu May 5 18:28:57 2016 +0530

----------------------------------------------------------------------
 .../fineract/portfolio/loanaccount/domain/Loan.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/e7fbec05/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 822b575..386f702 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
@@ -5053,6 +5053,10 @@ public class Loan extends AbstractPersistable<Long> {
                         accrualTransaction);
                 lastCompoundingDate = compoundingDetail.getEffectiveDate();
             }
+            LoanRepaymentScheduleInstallment lastInstallment = this.repaymentScheduleInstallments.get(this.repaymentScheduleInstallments
+                    .size() - 1);
+            reverseTransactionsPostEffectiveDate(incomeTransactions, lastInstallment.getDueDate());
+            reverseTransactionsPostEffectiveDate(accrualTransactions, lastInstallment.getDueDate());
         }
     }
 
@@ -5163,6 +5167,14 @@ public class Loan extends AbstractPersistable<Long> {
         return null;
     }
 
+    private void reverseTransactionsPostEffectiveDate(List<LoanTransaction> transactions,
LocalDate effectiveDate) {
+        for (LoanTransaction loanTransaction : transactions) {
+            if (loanTransaction.getTransactionDate().isAfter(effectiveDate)) {
+                loanTransaction.reverse();
+            }
+        }
+    }
+
     private List<LoanInterestRecalcualtionAdditionalDetails> extractInterestRecalculationAdditionalDetails()
{
         List<LoanInterestRecalcualtionAdditionalDetails> retDetails = new ArrayList<>();
         if (null != this.repaymentScheduleInstallments && this.repaymentScheduleInstallments.size()
> 0) {


Mime
View raw message