adamsaghy commented on code in PR #4334:
URL: https://github.com/apache/fineract/pull/4334#discussion_r1971430801
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/AbstractLoanRepaymentScheduleTransactionProcessor.java:
##########
@@ -239,7 +239,14 @@ protected void calculateAccrualActivity(LoanTransaction
loanTransaction, Monetar
Money interestPortion =
currentInstallment.getInterestCharged(currency);
Money feeChargesPortion =
currentInstallment.getFeeChargesCharged(currency);
Money penaltyChargesPortion =
currentInstallment.getPenaltyChargesCharged(currency);
- loanTransaction.updateComponentsAndTotal(principalPortion,
interestPortion, feeChargesPortion, penaltyChargesPortion);
+ if
(interestPortion.plus(feeChargesPortion).plus(penaltyChargesPortion).isZero()) {
+ loanTransaction.reverse();
+ } else {
+ loanTransaction.updateComponentsAndTotal(principalPortion,
interestPortion, feeChargesPortion, penaltyChargesPortion);
+ if (currentInstallment.isObligationsMet() &&
loanTransaction.getDateOf().isAfter(currentInstallment.getDueDate())) {
Review Comment:
Also in the previous comment i left you this:
"We should only update the transaction date of an Accrual Activity
transaction, if the **obligations met date** is earlier than the due date but
later than the from date of the period and we should not check whether the
current installment is fully paid or overpaid, but the whole loan is fully paid
or overpaid!
We want to change the existing accrual activity transaction date, if the
**loan got fully paid / overpaid** and this loan obligations met date is
between the period from and due date!"
We dont want to change Accrual activity transactions of future installments
(if applicable!)
--
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]