Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix statement line entry date year based on the statement date #117

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nieldw
Copy link
Contributor

@nieldw nieldw commented Jan 8, 2022

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 StatementLine constructor assumes it to be the same as the value date. In this case the post-processor may choose an incorrect year.

Closes #83

@nieldw
Copy link
Contributor Author

nieldw commented Jan 8, 2022

@qoomon , please advise if this PR corresponds with the conventions, package structure, etc. that you wish to maintain in this project. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant