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

Minor parsing errors #109

Open
htgoebel opened this issue Mar 25, 2024 · 2 comments
Open

Minor parsing errors #109

htgoebel opened this issue Mar 25, 2024 · 2 comments

Comments

@htgoebel
Copy link

Hi, thanks for this mighty module :-)

When parsing the statement shown below, I get some minor parsing errors in the field purpose:

  • No space before the applicant name
  • BIC is removed, but the string "BIC" is kept

Expected

  • Space between actual/main purpose (SVWZ) and applicant name (?32)
  • Either BIC removed or the actual BIC value (?30) appended: "BIC GENODEF1WDH"

Reproduce

import mt940, pprint
trans = mt940.parse
"""\
:61:2401231020DR30,00NDDTKREF+
:86:105?00Basislastschrift?10931?20EREF+DD-1-23.01.2024
?21KREF+20241022098765432109 00?22000000000237?23MREF+27
?24CRED+DE47ZZZ00012345678?25SVWZ+Mitgliedsbeitrag 
?26Mein Verein EREF: D?27D-1-23.01.2024 MREF: 27 CRE
?28D: DE47ZZZ00012345678 IBAN:?29 DE69280123450012345670 BIC
?30GENODEF1WDH?31DE69280123450012345670
?32Mein Verein e.V.?34992?60: GENODEF1WDH
""")
pprint.pp( trans[0].data)

Output:

…
 'purpose': 'MitgliedsbeitragMein Verein EREF: DD-1-23.01.2024 MREF: 27 CRED: '
            'DE47ZZZ00012345678 IBAN: DE69280123450012345670 BIC',
…
@github-actions github-actions bot added the Stale label Jan 16, 2025
@wolph
Copy link
Owner

wolph commented Jan 22, 2025

Thank you for the detailed bug report and apologies for the very slow response!

I'm not entirely sure what would be the correct way of handling this. The "standard" (https://github.com/betterplace/mt940_parser/blob/master/docs/MT940_Deutschland_Structure2002.pdf) only indicates that the ?30 is the BIC and ?31 is the iban and it doesn't specify anything about having "BIC" in front of it. Having that said, It appears to be doing the same for the IBAN with ?29 while the ?29 isn't specifically the IBAN as far as I'm aware, but that is probably bank dependent.

Which bank are you using? Perhaps they have more detailed documentation somewhere :)

@htgoebel
Copy link
Author

This issue is not related to ?30 or ?31, but only related to the ?29.

When looking at this original message, you can see that the ?2x fields contain also CRED: (split over two fields), IBAN: and others. And ?29 ends with BIC. To be this leaves the impression that the bank "missed" putting the BIC into the last ?29 field or that field got truncated somehow by the bank.

Anyway, in the parsed purpose this trailing BIC is of no use. This is why I ask to either remove the trailing BIC or append the actual BIC to the purpose. Which one you choose is up to you :-)

The bank is managed by the Atruvia data processing services (VR-Banken, etc.)

@github-actions github-actions bot removed the Stale label Jan 23, 2025
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