fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [1/2] incubator-fineract git commit: FINERACT-59 : corrected interest calculation for flat loans
Date Wed, 09 Mar 2016 06:57:02 GMT
Repository: incubator-fineract
Updated Branches:
  refs/heads/develop a6c9d3d3e -> b786d459b


FINERACT-59 : corrected interest calculation for flat loans


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

Branch: refs/heads/develop
Commit: 859c0affefe95d61c1cae8a7f158288591ba5ad0
Parents: 14499a2
Author: pramod <pramod@confluxtechnologies.com>
Authored: Mon Mar 7 17:15:56 2016 +0530
Committer: pramod <pramod@confluxtechnologies.com>
Committed: Mon Mar 7 17:15:56 2016 +0530

----------------------------------------------------------------------
 .../domain/LoanApplicationTerms.java            | 25 +++++++++++++-------
 1 file changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/859c0aff/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java
index 80e2530..68e9d83 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java
@@ -178,7 +178,7 @@ public final class LoanApplicationTerms {
     private Money adjustPrincipalForFlatLoans;
 
     private final LocalDate seedDate;
-    
+
     private final CalendarHistoryDataWrapper calendarHistoryDataWrapper;
 
     public static LoanApplicationTerms assembleFrom(final ApplicationCurrency currency, final
Integer loanTermFrequency,
@@ -235,7 +235,8 @@ public final class LoanApplicationTerms {
                 loanProductRelatedDetail, multiDisburseLoan, emiAmount, disbursementDatas,
maxOutstandingBalance, interestChargedFromDate,
                 principalThresholdForLastInstalment, installmentAmountInMultiplesOf, recalculationFrequencyType,
restCalendarInstance,
                 compoundingMethod, compoundingCalendarInstance, compoundingFrequencyType,
loanPreClosureInterestCalculationStrategy,
-                rescheduleStrategyMethod, loanCalendar, approvedAmount, annualNominalInterestRate,
loanTermVariations, calendarHistoryDataWrapper);
+                rescheduleStrategyMethod, loanCalendar, approvedAmount, annualNominalInterestRate,
loanTermVariations,
+                calendarHistoryDataWrapper);
     }
 
     public static LoanApplicationTerms assembleFrom(final ApplicationCurrency applicationCurrency,
final Integer loanTermFrequency,
@@ -250,7 +251,7 @@ public final class LoanApplicationTerms {
             final CalendarInstance compoundingCalendarInstance, final RecalculationFrequencyType
compoundingFrequencyType,
             final LoanPreClosureInterestCalculationStrategy loanPreClosureInterestCalculationStrategy,
             final LoanRescheduleStrategyMethod rescheduleStrategyMethod, final Calendar loanCalendar,
BigDecimal approvedAmount,
-            BigDecimal annualNominalInterestRate, final List<LoanTermVariationsData>
loanTermVariations, 
+            BigDecimal annualNominalInterestRate, final List<LoanTermVariationsData>
loanTermVariations,
             final CalendarHistoryDataWrapper calendarHistoryDataWrapper) {
 
         final Integer numberOfRepayments = loanProductRelatedDetail.getNumberOfRepayments();
@@ -326,7 +327,7 @@ public final class LoanApplicationTerms {
             interestRecalculationCompoundingMethod = interestRecalculationDetails.getInterestRecalculationCompoundingMethod();
         }
         final CalendarHistoryDataWrapper calendarHistoryDataWrapper = null;
-        
+
         return new LoanApplicationTerms(applicationCurrency, loanTermFrequency, loanTermPeriodFrequencyType,
numberOfRepayments,
                 repaymentEvery, repaymentPeriodFrequencyType, null, null, amortizationMethod,
interestMethod, interestRatePerPeriod,
                 interestRatePeriodFrequencyType, annualNominalInterestRate, interestCalculationPeriodMethod,
@@ -379,7 +380,8 @@ public final class LoanApplicationTerms {
             final CalendarInstance compoundingCalendarInstance, final RecalculationFrequencyType
compoundingFrequencyType,
             final BigDecimal principalThresholdForLastInstalment, final Integer installmentAmountInMultiplesOf,
             final LoanPreClosureInterestCalculationStrategy preClosureInterestCalculationStrategy,
final Calendar loanCalendar,
-            BigDecimal approvedAmount, List<LoanTermVariationsData> loanTermVariations,
final CalendarHistoryDataWrapper calendarHistoryDataWrapper) {
+            BigDecimal approvedAmount, List<LoanTermVariationsData> loanTermVariations,
+            final CalendarHistoryDataWrapper calendarHistoryDataWrapper) {
         this.currency = currency;
         this.loanTermFrequency = loanTermFrequency;
         this.loanTermPeriodFrequencyType = loanTermPeriodFrequencyType;
@@ -709,8 +711,13 @@ public final class LoanApplicationTerms {
             case INVALID:
             break;
             case SAME_AS_REPAYMENT_PERIOD:
-                LocalDate startDate = getExpectedDisbursementDate();
-                periodsInLoanTerm = calculatePeriodsBetweenDates(startDate, this.loanEndDate);
+                if (this.allowPartialPeriodInterestCalcualtion) {
+                    LocalDate startDate = getExpectedDisbursementDate();
+                    if (getInterestChargedFromDate() != null) {
+                        startDate = getInterestChargedFromLocalDate();
+                    }
+                    periodsInLoanTerm = calculatePeriodsBetweenDates(startDate, this.loanEndDate);
+                }
             break;
         }
 
@@ -1429,8 +1436,8 @@ public final class LoanApplicationTerms {
     public LocalDate getSeedDate() {
         return this.seedDate;
     }
-    
-    public CalendarHistoryDataWrapper getCalendarHistoryDataWrapper(){
+
+    public CalendarHistoryDataWrapper getCalendarHistoryDataWrapper() {
         return this.calendarHistoryDataWrapper;
     }
 


Mime
View raw message