fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [2/4] incubator-fineract git commit: MIFOSX-2565 : fixed prepay with floating rates
Date Wed, 11 May 2016 07:52:23 GMT
MIFOSX-2565 : fixed prepay with floating rates


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

Branch: refs/heads/develop
Commit: 72a1fff6454b76514da45efb9f0ce7fc1e5d22e1
Parents: d2b8535
Author: pramod <pramod@confluxtechnologies.com>
Authored: Wed May 11 11:39:15 2016 +0530
Committer: pramod <pramod@confluxtechnologies.com>
Committed: Wed May 11 11:39:15 2016 +0530

----------------------------------------------------------------------
 .../domain/AbstractLoanScheduleGenerator.java           | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/72a1fff6/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java
index d06b3f1..474b852 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java
@@ -547,12 +547,24 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
                 updateFixedInstallmentAmount(mc, loanApplicationTerms, scheduleParams.getPeriodNumber(),
loanApplicationTerms
                         .getPrincipal().minus(scheduleParams.getTotalCumulativePrincipal()));
             }
+            
+            // this is to make sure we are recalculating using correct interest rate 
+            // once calculation is done system will set the actual interest rate
+            BigDecimal currentInterestRate = loanApplicationTerms.getAnnualNominalInterestRate();
+            for(LoanTermVariationsData interestRate : interestRates){
+                if(interestRate.isApplicable(periodStartDateApplicableForInterest)){
+                    loanApplicationTerms.updateAnnualNominalInterestRate(interestRate.getDecimalValue());
+                }
+            }
+            
             PrincipalInterest interestTillDate = calculatePrincipalInterestComponentsForPeriod(this.paymentPeriodsInOneYearCalculator,
                     interestCalculationGraceOnRepaymentPeriodFraction, scheduleParams.getTotalCumulativePrincipal(),
                     scheduleParams.getTotalCumulativeInterest(), totalInterestChargedForFullLoanTerm,
                     lastTotalOutstandingInterestPaymentDueToGrace, scheduleParams.getOutstandingBalanceAsPerRest(),
loanApplicationTerms,
                     scheduleParams.getPeriodNumber(), mc, mergeVariationsToMap(scheduleParams),
scheduleParams.getCompoundingMap(),
                     periodStartDateApplicableForInterest, calculateTill, interestRates);
+            loanApplicationTerms.updateAnnualNominalInterestRate(currentInterestRate);
+            
             // applies charges for the period
             final ScheduleCurrentPeriodParams tempPeriod = new ScheduleCurrentPeriodParams(
                     totalInterestChargedForFullLoanTerm.getCurrency(), interestCalculationGraceOnRepaymentPeriodFraction);


Mime
View raw message