JebronLames32 commented on code in PR #4522:
URL: https://github.com/apache/fineract/pull/4522#discussion_r2020129262
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -2877,7 +2877,7 @@ public CommandProcessingResult chargeOff(JsonCommand
command) {
throw new
GeneralPlatformDomainRuleException("error.msg.loan.is.already.charged.off",
"Loan: " + loanId + " is already charged-off", loanId);
}
- if (DateUtils.isBefore(transactionDate,
loan.getLastUserTransactionDate())) {
+ if (DateUtils.isBefore(transactionDate,
loan.getLastNonReversedUserTransactionDate())) {
Review Comment:
I think the function `loan.getLastUserTransactionDate()` is working fine. It
is not considering reversed transactions and returning the last valid
transaction date or the disbursement date if there is no valid user
transaction. No change seems to be required as this is not the function causing
the issue.
On evaluating the result of the function loan.getLastUserTransactionDate()`:

with the previous transactions being:

The result seems to be right and is not considering reversed transactions
--
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]