kedder / ofxstatement-iso20022

ISO20022 plugin for ofxstatement
9 stars 15 forks source link

Missing FITID in generated OFX #11

Open ntf1974 opened 3 years ago

ntf1974 commented 3 years ago

Trying to further process OFX generated from ISO20022-camt052 (also applies to camt053 Source) with Tryton ERP (which relies - by my knowledge - on python ofxparse) gives me an Error "ofxparse.ofxparse.OfxParserException: Missing FIT id (a required field)"

May it be an idea to add generation of FITID to the plugin like the MT940 Plugin does? Or am I missing some knowledge to correctly further process the OFX files?

I've tried to add the generation of FITID by myself based on the implementation in MT940 Plugin. The subsequently converted files can be successfully processed by ofxparse.

Changes i've made to the iso20022-Plugin:

6a7

from typing import Set, Iterator, Any, IO 11a13 from ofxstatement.statement import generate_unique_transaction_id 38a41 unique_id_set: Set[str] 42a46 self.unique_id_set = set() 154a159,163

            sline.id = generate_unique_transaction_id(sline, self.unique_id_set)
            m = re.match(r'([0-9a-f]+)(-\d+)?$', sline.id)
            assert m, "Id should match hexadecimal digits, optionally followed by a minus and a counter: '{}'".format(sline.id)

Regards Chris