wimverstuyf / php-coda-parser

PHP parser for Belgian CODA banking files
GNU Lesser General Public License v3.0
41 stars 25 forks source link

New Balance/New Situation bank account is not parsed correctly #7

Closed Thijs-Riezebeek closed 7 years ago

Thijs-Riezebeek commented 7 years ago

I have noticed a bug in the implementation of the "New Situation" parser.

It first does $this->add_account_info($coda8, substr($coda8_line, 4, 37));, which in turn checks the first character of that substring as follows: substr($account_info, 0, 1) == "0", and the same for 1, 2 and 3.

The problem with this is that these 34 characters should not contain that account structure character. It says in the documentation that:

"Position 2 of the type 1 data record determines the account structure to be used".

This means that the account structure character from the "old situation" should be used to interpret these 34 characters.

Therefore the current implementation is incorrect.

wimverstuyf commented 7 years ago

Nice catch. The implementation is incorrect.

I have "fixed" it in master by removing parsing of the account-info. Doesn't seem to be very useful anyway as this information is already parsed in "OriginalSituation".