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


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeService.java:
##########
@@ -575,49 +608,67 @@ private BigDecimal 
calculatePerInstallmentChargeAmount(final Loan loan, final Lo
     }
 
     private void updateInstallmentCharges(final LoanCharge loanCharge) {
-        final Collection<LoanInstallmentCharge> remove = new HashSet<>();
+        for (LoanInstallmentCharge oldCharge : 
loanCharge.getLoanInstallmentCharge()) {
+            
oldCharge.getInstallment().getInstallmentCharges().remove(oldCharge);
+        }
+        loanCharge.getLoanInstallmentCharge().clear();

Review Comment:
   Why do we need to drop all charges? That would recreate charges every 
time... Was the previous version which only updated the existing once 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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to