You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "adamsaghy (via GitHub)" <gi...@apache.org> on 2023/05/09 11:20:26 UTC

[GitHub] [fineract] adamsaghy commented on a diff in pull request #3157: FINERACT-1724-Accrual-reversal-multiple-disbursement

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: commits-unsubscribe@fineract.apache.org

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