Dhanno98 commented on code in PR #5940:
URL: https://github.com/apache/fineract/pull/5940#discussion_r3454206426
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeService.java:
##########
@@ -232,6 +232,11 @@ public void addLoanCharge(final Loan loan, final
LoanCharge loanCharge) {
update(loanCharge, chargeAmt, loanCharge.getDueLocalDate(), amount,
loan.fetchNumberOfInstallmentsAfterExceptions(),
totalChargeAmt);
+ // Skip zero-value charges
Review Comment:
Fixed. The silent return for zero-amount charges has been removed. A
validation check is added in `LoanChargeService.addLoanCharge()`. If the
calculated charge amount becomes zero after applying rounding rules, a
`LoanChargeCannotBeAddedException` is now raised with the message
`error.msg.loanCharge.cannot.be.added.as.amount.rounded.to.zero`. This prevents
the charge from being created and returns an explicit validation error to the
client instead of silently ignoring the request.
--
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]