Fix statement line entry date year based on the statement date#117
Open
nieldw wants to merge 1 commit intoqoomon:mainfrom
Open
Fix statement line entry date year based on the statement date#117nieldw wants to merge 1 commit intoqoomon:mainfrom
nieldw wants to merge 1 commit intoqoomon:mainfrom
Conversation
Contributor
Author
|
@qoomon , please advise if this PR corresponds with the conventions, package structure, etc. that you wish to maintain in this project. Thanks |
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.
After a bit more than a year I finally managed to re-implement this according to our discussion on PR #83.
This implementation infers the correct year for the entry date of a statement line based on the shortest interval between the entry date's month-day and the statement date. For MT940 the statement date is taken to be the date of the closing balance (
:62F:or:62M); for MT942 the statement date is the date-time indicator (:13D:).After reading the whole statement page, the statement lines are post-processed to adjust the entry dates, because in the case of MT940 the statement date is only available after reading all the statement lines.
Caveat: The entry date is an optional field, but if it is absent the
StatementLineconstructor assumes it to be the same as the value date. In this case the post-processor may choose an incorrect year.Closes #83