# Poor experience with MT940 statement import :-(

**URL:** <https://discuss.tryton.org/t/poor-experience-with-mt940-statement-import/7112>\
**Category:** Developer\
**Created:** [March 24, 2024, 10:13pm UTC](https://discuss.tryton.org/t/poor-experience-with-mt940-statement-import/7112 "2024-03-24T22:13:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![htgoebel](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/htgoebel/32/1256_2.png) [@htgoebel](https://discuss.tryton.org/u/htgoebel)\
**Post date:** [March 24, 2024, 10:13pm UTC](https://discuss.tryton.org/t/poor-experience-with-mt940-statement-import/7112/1 "2024-03-24T22:13:44Z")

</div>

This weekend I tested importing MT940 statements. And I’m sorry to say: `trytond-account-statement-mt940` has a pooooor user experience. This is really not a figurehead for Tryton. I would fully understand any company turning away from Tryton after testing MT940 statement import. We’d better not publish this module than publishing it in this quality!

**Is there an alternative implementation for MT940 statement import?**

These are the bugs I found when trying to import my real-live MT940 statement:

- Importing a transaction dated 30th of February fails.

- Importing a multi-line description fails with “illegal character ‘\n’” - well actually MT940 does not have multi-line descriptions since these lines are joined into a single line.

- The description lines are not parsed properly: It contains many markers for sub-fields. (This seem to be a special encoding used be German Banks.)

After I hacked the code and was able to import the statement:

- There is a separate “Statement” for each transaction day. How do you handle this?  
Also the Name is always Zero (from field `28C`). Is this a restriction of MT940?  

- None of these "Statement"s contains a “statement line”:  

I tested parsing my statement file with [mt-940 · PyPI](https://pypi.org/project/mt-940/) and it does a much, much better job:

- 30th of February is handled (moved to 29th)
- description does not contain newlines
- these `?21` fields in description are parsed into many details like applicant name, IBAN, creditor id(!), posting text, and more if available
- This module implements a full MT940 parser and has a quite huge test-suite, containing more then 51 statement files, including some of Abn Amro, ING, RaboBank — which `trytond-account-statement-mt940` has special treatment for.

Maybe one making money with Tryton should step forward and implement a MT940 statement report based on the mt-940 package?
