Cocoa-Puffs commented on PR #6469: URL: https://github.com/apache/fineract/pull/6469#issuecomment-5773694969
Both findings turned out to be correct. `recalculateClosedOnDate(loan)` became `recalculateSettlementDates(loan, statusBeforeEvent)`, covering the OVERPAID branch as well as the closed one. I've extended the repository query to return the date of the newest live repayment-like transaction whose allocation is not entirely overpayment. The overpaid branch can now set this date directly. The closed branch now considers whether the loan was overpaid going into the current transaction processing, if prior the loan was overpaid and now it is simply closed it means that the current transaction is takins some sort of excess away. In this case the obligationMetOnDate is assigned outright, meaning they can move "earlier" as the loan is falling back onto a settlement that already happened. Otherwise the event is what settled the loan, and it may not have been a repayment. Each date only moves later, never earlier, so a settlement completed by a non-repayment keeps the transition's own date. -- 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]
