alberto-art3ch commented on code in PR #4643:
URL: https://github.com/apache/fineract/pull/4643#discussion_r2075916513


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java:
##########
@@ -1542,4 +1552,34 @@ public Pair<Loan, Map<String, Object>> 
assembleLoanApproval(AppUser currentUser,
         return Pair.of(loan, actualChanges);
     }
 
+    private Set<LoanCharge> separateTotalCompoundingPercentageCharges(final 
Set<LoanCharge> loanCharges) {
+        Set<LoanCharge> interestCharges = new HashSet<>();
+        if (loanCharges != null) {
+            for (final LoanCharge loanCharge : loanCharges) {
+                if ((loanCharge.isSpecifiedDueDate() || 
loanCharge.isDisbursementCharge())
+                        && 
(loanCharge.getChargeCalculation().isPercentageOfInterest()
+                                || 
loanCharge.getChargeCalculation().isPercentageOfAmountAndInterest())) {
+                    interestCharges.add(loanCharge);
+                }
+            }
+            loanCharges.removeAll(interestCharges);
+        }
+        return interestCharges;
+    }
+
+    private void updateDisbursementWithCharges(final 
Collection<LoanScheduleModelPeriod> periods,
+            final Set<LoanCharge> nonCompoundingCharges) {
+        final BigDecimal totalInterest = periods.stream().filter(p -> 
p.isRepaymentPeriod()).map(LoanScheduleModelPeriod::interestDue)
+                .reduce(BigDecimal.ZERO, BigDecimal::add);
+        for (LoanScheduleModelPeriod loanScheduleModelPeriod : periods) {
+            if (loanScheduleModelPeriod instanceof 
LoanScheduleModelDisbursementPeriod) {
+                log.info("Period {}", loanScheduleModelPeriod.periodNumber());

Review Comment:
   Done! Code updated



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