railslove / cmxl

your friendly MT940 SWIFT file parser for bank statements
http://railslove.com
MIT License
46 stars 25 forks source link

Tag 86 at the end does not get parsed #27

Open sprileyMSTS opened 5 years ago

sprileyMSTS commented 5 years ago

I have :86: at the end of a statement. Per https://www.sepaforcorporates.com/swift-for-corporates/account-statement-mt940-file-format-overview/ this tag is to be treated as meta data at the statement level: Tag 86 – Information to Account Owner Optional – 6x65x Additional information about the statement as a whole

In debugging it in the parser, this tag is getting associated as meta data for tag 64 (Available Balance) which immediately precedes it AND does not have an add_meta_data method. I believe this information should be added at the statement level as meta data. In my case the value is ":86:/OSDR/HSBCPLPW" which is the SWIFT code or BIC.

Uepsilon commented 5 years ago

@sprileyMSTS sorry for the delay

i saw this myself a few times. but most banks add information related to transactions. the additional information at the end of a statement is omitted most of the times.

which swift code or bic do you get from you statement? is it the one of your account? it should not be related to any transaction as there might be multiple per statement.

is this something we should work on together? :)

sprileyMSTS commented 5 years ago

In our case, HSBC is providing it as the SWIFT code for our bank account. We receive multiple files from multiple sources that we are processing, so this piece of information is useful for knowing which account at which bank we are dealing with (banks seem to be less than reliable about whether they use the IBAN in Tag 25. Ultimately we ended up not relying on this information, but expanding how we parse the account number and looking up the SWIFT code for our purposes.