Closed nickidk4 closed 5 years ago
Hmmm, could you send an example which does not work ? The issue is not clear frankly. Also please in text not in a screenshot ;)
The lib does support multiline data https://github.com/a-fas/mt940js/blob/master/test/parser.test.js#L14 https://github.com/a-fas/mt940js/blob/master/test/parser.test.js#L112 So ... should work ...
The tests you linked to shows that Tag 86 can handle multiple lines. But tag 61 can have multiple lines as well.
Ah, ok ... :) I'll have a look but an example would be very helpful
Well swift messages contain quite private info. Will check with my boss how I can help you with examples :) And I will see if I can start making pull requests instead of pasting code in comments.
Had a look, in fact the additional line in tag 61 was supported already, but had a bug :)
Fixed and added a test.
Try the latest code (not released as npm yet), if OK I'll release. The transaction attribute is called extraDetails
.
It still doesnt work. When I have tag 61 with newline it fails. Only works when I use my own fix.
:61:180901D10,00NTRF6100103A82462003//03MT180933175035
/OCMT/EUR10,00/
Hmmm, are you sure you're using the last code (right from the repo - I didn't publish on npm yet).
Just pasted your line to example file (in test dir) and run it with cli.js
- seems to work well. (had to change the amount and date also ...)
I see now how it works. And it works :)
Parser can't handle extra data field. In Parser.js Instead of splitting on '\n' you need to split on '\n:'. If you split on '\n' you will split on the newline inside tag 61. instead of newline at the end of tag 61.
parser.js:111
And then dont include ":" in retag.
parser.js:126
It took me quite some time to locate the bug. Hope you can update with my fix soon, or another alternative :)