adamsaghy commented on code in PR #4961:
URL: https://github.com/apache/fineract/pull/4961#discussion_r2303378011
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java:
##########
@@ -1969,21 +1980,19 @@ public DisbursementData mapRow(final ResultSet rs,
@SuppressWarnings("unused") f
final BigDecimal principal = rs.getBigDecimal("principal");
final String loanChargeId = rs.getString("loanChargeId");
final BigDecimal netDisbursalAmount =
rs.getBigDecimal("netDisbursalAmount");
- BigDecimal chargeAmount = rs.getBigDecimal("chargeAmount");
- final BigDecimal waivedAmount = rs.getBigDecimal("waivedAmount");
- if (chargeAmount != null && waivedAmount != null) {
- chargeAmount = chargeAmount.subtract(waivedAmount);
- }
+ final BigDecimal chargeAmount = rs.getBigDecimal("chargeAmount");
+ // Waived amount is already subtracted in SQL aggregation
Review Comment:
Dont we break the DisbursementData by not providing the "original" charge
amount and the waived amount? Why did you decide to deduct immediately and set
waived amoutn to be `null`?
--
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]