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 06:43:53 GMT

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



##########
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:
       This PR is already merged, so I have raised new #967, could you please confirm there
if that one looks good to you, if you agree that this was wrong?




----------------------------------------------------------------
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