adamsaghy commented on code in PR #3157:
URL: https://github.com/apache/fineract/pull/3157#discussion_r1188510553


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -1332,16 +1332,27 @@ private void applyPeriodicAccruals(final 
Collection<LoanTransaction> accruals) {
                     interest = 
interest.plus(loanTransaction.getInterestPortion(getCurrency()));
                     fee = 
fee.plus(loanTransaction.getFeeChargesPortion(getCurrency()));
                     penality = 
penality.plus(loanTransaction.getPenaltyChargesPortion(getCurrency()));
-                    if 
(installment.getFeeChargesCharged(getCurrency()).isLessThan(fee)
+                    final boolean isAmountDifferent = 
installment.getFeeChargesCharged(getCurrency()).isLessThan(fee)
                             || 
installment.getInterestCharged(getCurrency()).isLessThan(interest)
-                            || 
installment.getPenaltyChargesCharged(getCurrency()).isLessThan(penality)
-                            || 
(getAccruedTill().isEqual(loanTransaction.getTransactionDate())

Review Comment:
   i would rather add the `isInterestBearing` condition into the last condition:
   
   ```
   (isInterestBearing() && 
getAccruedTill().isEqual(loanTransaction.getTransactionDate()) && 
!installment.getDueDate().isEqual(getAccruedTill()))
   ```
   
   So we dont need this many code duplication



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to