You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "alberto-art3ch (via GitHub)" <gi...@apache.org> on 2026/10/22 12:04:53 UTC

[PR] FINERACT-2968: Snap ideal disbursement date to anchor day [fineract]

alberto-art3ch opened a new pull request, #6721:
URL: https://github.com/apache/fineract/pull/6721

   ## Description
   
   Cumulative loans with monthly repayments and actual-days interest charged first-period interest from before the disbursement date when the loan was disbursed on the 29th–31st.
   
   `DefaultScheduledDateGenerator.idealDisbursementDateBasedOnFirstRepaymentDate` derived the ideal disbursement date as `firstRepaymentDate.minusMonths(repaidEvery)`. When the first due date had been clamped into a shorter month (31 Jan -> 28 Feb), subtracting the period landed on 28 Jan instead of 31 Jan, so `AbstractCumulativeLoanScheduleGenerator.calculateInterestStartDateForPeriod` started interest 3 days early (31 days instead of 28; 101.92 instead of 92.05 on 10,000 at 12%).
   
   The fix applies the same month-end clamp (`adjustDate` against the loan seed date) that the forward generation already uses, so the backward step mirrors the forward one. Only the `MONTHS` branch without a loan calendar changes; interest-charged-from-date, the `interest-charged-from-date-same-as-disbursal-date` config and 30/360 loans are unaffected.
   
   [FINERACT-2968](https://issues.apache.org/jira/browse/FINERACT-2968)
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   - [ ] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
   - [ ] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
   - [ ] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
   - [ ] If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
   - [ ] I followed the [AI Policy](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#ai-policy).
   
   Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
   


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org