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

The DTEND tag in the OFX should be exclusive but is calculated inclusive #102

Open
gpaulissen opened this issue Mar 16, 2020 · 1 comment

Comments

@gpaulissen
Copy link
Contributor

The OFX 2.2 specifications on page 87 mention this:

• is the date and time that, if used by the client as the next requested , it would pick up exactly where the current response left off. It is the exclusive date and time in history where the server stopped looking for information, based on the request rules.

So DTEND is an exclusive date.

The code in ofx.py:

    self.buildDate("DTEND", self.statement.end_date, False)

But in function recalculate_balance in statement.py the end_date is calculated inclusive:

stmt.end_date = max(sl.date for sl in stmt.lines)

The ofxstatement documentation is not clear about this and it will lead to balance inconsistencies as I have already experienced.

@kedder
Copy link
Owner

kedder commented Mar 16, 2020

Hmm, I don't really understand the problem. What is the difference between "inclusive" and "exclusive" dates?

recalculate_balance attempts to calculate the account balance at the start and end of statement' period in case this information is not provided explicitly in the original data source. Can you given an example when it doesn't do what you would expect?

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

No branches or pull requests

2 participants