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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanSummary.java:
##########
@@ -211,14 +211,15 @@ public void zeroFields() {
 
     public void updateSummary(final MonetaryCurrency currency, final Money 
principal,
             final List<LoanRepaymentScheduleInstallment> 
repaymentScheduleInstallments, final LoanSummaryWrapper summaryWrapper,
-            final Boolean disbursed, Set<LoanCharge> charges) {
+            final Boolean disbursed, Set<LoanCharge> charges, final Money 
credits, final Money debits) {
 
         this.totalPrincipalDisbursed = principal.getAmount();
         this.totalPrincipalRepaid = 
summaryWrapper.calculateTotalPrincipalRepaid(repaymentScheduleInstallments, 
currency).getAmount();
         this.totalPrincipalWrittenOff = 
summaryWrapper.calculateTotalPrincipalWrittenOff(repaymentScheduleInstallments, 
currency)
                 .getAmount();
 
-        this.totalPrincipalOutstanding = 
principal.minus(this.totalPrincipalRepaid).minus(this.totalPrincipalWrittenOff).getAmount();
+        this.totalPrincipalOutstanding = 
principal.minus(this.totalPrincipalRepaid).minus(this.totalPrincipalWrittenOff).plus(credits)

Review Comment:
   adding the "debits" and also the "credits" seems weird to me. Can you please 
understand the difference?



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