kulminsky commented on code in PR #4273:
URL: https://github.com/apache/fineract/pull/4273#discussion_r1930588238


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualsProcessingServiceImpl.java:
##########
@@ -355,6 +355,7 @@ private void addAccruals(@NotNull Loan loan, @NotNull 
LocalDate tillDate, boolea
                 if (accrualTransaction != null) {
                     accrualTransactions.add(accrualTransaction);
                 }
+                addTransactionMappings(accrualTransaction, period, false);

Review Comment:
   Removed



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualActivityProcessingServiceImpl.java:
##########
@@ -92,42 +92,98 @@ public void processAccrualActivityForLoanClosure(@NotNull 
Loan loan) {
         if 
(!loan.getLoanProductRelatedDetail().isEnableAccrualActivityPosting()) {
             return;
         }
+
         LocalDate transactionDate = loan.isOverPaid() ? 
loan.getOverpaidOnDate() : loan.getClosedOnDate();
-        // reverse after closure activities
+
+        // Reverse accrual activities posted after the closure date
         loan.getLoanTransactions(t -> t.isAccrualActivity() && !t.isReversed() 
&& t.getDateOf().isAfter(transactionDate))
                 .forEach(this::reverseAccrualActivityTransaction);
 
-        // calculate activity amounts
         BigDecimal feeChargesPortion = BigDecimal.ZERO;
         BigDecimal penaltyChargesPortion = BigDecimal.ZERO;
         BigDecimal interestPortion = BigDecimal.ZERO;
-        // collect installment amounts
+
+        // Calculate total portions from all installments
         for (LoanRepaymentScheduleInstallment installment : 
loan.getRepaymentScheduleInstallments()) {
-            feeChargesPortion = MathUtil.add(feeChargesPortion, 
installment.getFeeChargesCharged());
-            penaltyChargesPortion = MathUtil.add(penaltyChargesPortion, 
installment.getPenaltyCharges());
-            interestPortion = MathUtil.add(interestPortion, 
installment.getInterestCharged());
+            if (!installment.isDownPayment() && 
!installment.getDueDate().isAfter(transactionDate)) { // Exclude

Review Comment:
   Done



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