fruitl00p / php-mt940

A mt940 parser in PHP
MIT License
103 stars 60 forks source link

Statements in different currencies to not have correct Start/End price #51

Closed ramondelafuente closed 5 years ago

ramondelafuente commented 7 years ago

The regular expression used to parse the statements has a hardcoded EUR, where the currency could be something else. This results in an empty start and end balance value.

The regex: /:62F:([CD])?.*EUR([\d,\.]+)*/

could be: /:62F:([CD])?.*(?:[A-Z]{3})([\d,\.]+)*/

But then there need to be testfiles with different currencies also, and perhaps it would be nice to actually capture the currency and add it to the statement.

fruitl00p commented 7 years ago

@ramondelafuente you're absolutely right, BUT i havent had any opportunity to test with other currencies other than EUR (all test files I've seen from the various banks and institutions seem to be EUR only... ?)

But you are correct that the EUR doesn't actually belong in there like that...

fruitl00p commented 5 years ago

@ramondelafuente just to close this off, this has been fixed by #55. I've also noticed this isn't in an official new release yet but dev-master does include the fix :)