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

First intermediate_opening_balance line missing #105

Open
phamthangpri opened this issue Oct 12, 2023 · 5 comments
Open

First intermediate_opening_balance line missing #105

phamthangpri opened this issue Oct 12, 2023 · 5 comments

Comments

@phamthangpri
Copy link

phamthangpri commented Oct 12, 2023

Hi,

How can I get the first line on intermediate_opening_balance and account_identification ?
Here is the parsing result with this info missing :
image

Here is my file :
image

Thanks,

@phamthangpri phamthangpri changed the title How can I parse the tag 25 AccountIdentification First intermediate_opening_balance line missing Oct 12, 2023
@wolph
Copy link
Owner

wolph commented Oct 21, 2023

The file doesn't appear to have an intermediate_opening_balance, only an opening_balance (the :60F:: https://mt940.readthedocs.io/en/latest/mt940.tags.html#module-mt940.tags

The account identification data is across the entire file so that's in the transactions (plural) object, not in a singular transaction.

@phamthangpri
Copy link
Author

but sometimes, it can not retrieve the account_identification in the entire file, all account_identification values in transactions are null.

@wolph
Copy link
Owner

wolph commented Oct 26, 2023

That is very odd, that should only happen if it either doesn't detect the field at all or if something is overwriting it. Do you have any (anonymised) files you can send to test?

@phamthangpri
Copy link
Author

Hi,
Yes,
Here is an example but didn't check if all account identifications are detected. I'm on holiday now. If this file works, I send you another one after my holiday.
https://docs.google.com/document/d/1K73rB2Yu2JRWTuy1k0oEtqS-em98px0O9NgEW5AcaXs/edit?usp=drivesdk

But yesterday, I read 7000 files and it didn't work very well. Just 30% of account identifications were detected. Finally, I needed to dev by myself to read the account identification.

Thanks

@wolph
Copy link
Owner

wolph commented Nov 8, 2023

I've done a bit of research and as far as I can see it's properly parsing the account identifications without issues. But... the account identification is in the transactions object and not the transaction itself.

To illustrate:

transactions = mt940.parse('test.mt940')

for transaction in transactions:
    print(transactions.data['account_identification'], transaction)

With the loglevel set to debug you can see what it is and is not parsing but that gets very verbose. But it does show the account_identification for me in these cases. Perhaps you can share some other testdata where it fails?

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