Repository navigation
FINERACT-752: Fix duplicate manual interest posting when posting at period end - #6665
Merged
adamsaghy merged 1 commit intoOct 15, 2026
Conversation
…eriod end
With savings-interest-posting-current-period-end enabled, a manual
("post interest as on") interest posting is dated on the period end
date instead of the day after it. When a later backdated transaction
recalculated interest, SavingsAccount passed that stored date to
determineInterestPostingPeriods as if it were a posting date, so the
period was split one day earlier and another interest posting was
created for the same period. Every further backdated transaction added
one more.
Shift the stored manual posting dates forward by one day when the
configuration is enabled, so they mark the same period boundary again.
adamsaghy
approved these changes
Oct 15, 2026
adamsaghy
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Traced the FINERACT-752 scenario: shifting the stored manual posting dates by one day restores the same period split as with the configuration disabled, so the existing manual posting is corrected instead of duplicated. Disabled path is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes FINERACT-752. With
savings-interest-posting-current-period-endenabled, a manual ("post interest as on") interest posting is duplicated when a backdated transaction recalculates interest, and every further backdated transaction adds one more posting for the same period.Cause
With the configuration enabled,
PostingPerioddates a manual posting on the period end date instead of the day after it. On recalculation,SavingsAccount.calculateInterestUsingpassed that stored date toSavingsHelper.determineInterestPostingPeriods, which treats every date as a posting date and ends the period on the previous day. The period moved one day earlier, the existing posting no longer matched it, and another posting was created.Change
When the configuration is enabled, the stored manual posting dates are shifted forward by one day before the periods are split, so they mark the same period boundary as when the configuration is disabled. Nothing changes when the configuration is disabled.
Test
The configuration description says "There is no difference in the interest amount posted".
testManualInterestPostingIsNotDuplicatedWhenPostingAtPeriodEndruns the same scenario (business date 02 April 2019: deposit, post interest as on 25 March, two backdated transactions) with the configuration disabled and enabled, and checks that the interest postings have the same amounts and are dated one day earlier. It fails on develop (expected: <2> but was: <4>) and passes with this change.Reproduction (steps from the Jira issue, develop
d924f025d2, PostgreSQL 18)I also compared develop and this change in 16 API scenarios (as on the first and last day of a month, backdated deposit, several recalculations, undo, quarterly posting, daily compounding, withdrawal fee, pivot mode, business dates). With this change the enabled case matches the disabled case in all transaction scenarios, and the disabled case is unchanged in every scenario.
Notes
Checklist