Closed nickidk4 closed 5 years ago
details is ''
by default - https://github.com/a-fas/mt940js/blob/master/lib/parser.js#L273
Does this mean that you have tag 86 without preceding tag 61 ?
P.S. example would help ;) all of real bugs should be unit tested, and UTs require examples ... ;)
Yes I have a swift with a tag 86 wihout preceeding tag 61 :)
Tag 61 is optional.
really need an example. This does not make sense to me. The main information in the transaction is it's amount, so tag 61 is kind of header for tag 86. it can exist without 86 but the opposite does not make sense.
I have censored an example swift for you here :) And yes it doesn't make sense not to include the 61 tag..
{1:F01ESSEDK22AXXX7000000000}{2:O0000000000000BBHCUS33LXXX02305811441800000000N}{3:{108:D87R000000001380}}{4:
:20:X00240000000000K
:25:2000000
:28C:8/1
:60F:C180924DKK0000000,54
:62F:C180924DKK0000000,54
:86:00127589001
DKK XXXX XXXX DK CB(MT) SMF 30
JAPAN XXXXXX XXXXXX BANK, LTD.
RE SMTB XXXXXXX COVERED BOND
(MID TERM XXXX) XXXXXXXX XXXX FUND
-}{5:{CHK:DBDD000XXX00}{DLM:}{CAC:VALIDATION SUCCESS}}
ok ... so it is at the very end ... it is kind of comment to the whole statement ... I'll see what can be done btw seems to be a part of the spec in this way: https://www2.swift.com/knowledgecentre/publications/us9m_20180720/2.0?topic=ajc.htm%23genajc
I see.. So tag 86 can be both like a comment to the transaction (61) and to the swift itself.
check the latest code, should be in informationToAccountOwner
at the statement level
https://github.com/a-fas/mt940js/blob/master/test/parser.test.js#L255
Works :)
If swift does not contain tag 61 it fails with error: TypeError: Cannot read property 'details' of undefined
Code must check if t is not undefined.
parser.js:279