fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] vorburger commented on a change in pull request #960: FINERACT-977-fix possible NPE in AbstractLoanScheduleGenerator
Date Tue, 02 Jun 2020 05:02:11 GMT

vorburger commented on a change in pull request #960:
URL: https://github.com/apache/fineract/pull/960#discussion_r433621124



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java
##########
@@ -636,10 +637,12 @@ private void updateAmountsBasedOnCurrentEarlyPayments(final MathContext
mc, fina
                     scheduleParams.getReducePrincipal(),
                     scheduleParams.getTotalCumulativePrincipal().plus(currentPeriodParams.getPrincipalForThisPeriod())
                             .plus(currentPeriodParams.getEarlyPaidAmount()), scheduleParams.getPeriodNumber()
+ 1, mc));
-            if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment()
-                    && fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount())
!= 0) {
-                currentPeriodParams.setEmiAmountChanged(true);
-            }
+          if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment()
+            && fixedEmiAmount != null
+            && fixedEmiAmount.compareTo(loanApplicationTerms.getFixedEmiAmount())
!= 0) {
+            currentPeriodParams.setEmiAmountChanged(true);
+            currentPeriodParams.plusPrincipalForThisPeriod(currentPeriodParams.getEarlyPaidAmount());

Review comment:
       Whoa! @maektwain hang on - you probably mistakenly added this extra duplicate line
here, right?  :sob:  Or was this intentional, and I'm not getting it? I'm proposing to remove
it again in #967... do you agree? (I'm not sure if it's causing FINERACT-855 or if that's
an unrelated problem.)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message