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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeWritePlatformServiceImpl.java:
##########
@@ -1041,7 +1041,8 @@ private boolean addCharge(final Loan loan, final Charge 
chargeDefinition, LoanCh
 
         // we want to apply charge transactions only for those loans charges 
that are applied when a loan is active and
         // the loan product uses Upfront Accruals
-        if (loan.getStatus().isActive() && 
loan.isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()) {
+        if ((loan.getStatus().isActive() && 
loan.isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct())
+                || (loan.getStatus().isOverpaid() && 
loan.isPeriodicAccrualAccountingEnabledOnLoanProduct())) {

Review Comment:
   Would you mind to change the condition to:
   - Allow to create the accrual transaction if the loan is closed? I dont 
think we need the "is periodic accrual enabled" and also CLOSED_OBLIGATIONS_MET 
is a valid outcome after the charge was added:
   - It was overpaid but charge was added and now it is closed (edge case, but 
why not...)



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