This pull request addresses the issue reported in https://github.com/wimverstuyf/php-coda-parser/issues/29.
The problem concerns to the incorrect parsing of grouped transactions with detailed transaction lines (e.g. SEPA transactions).
Problem
Grouped transactions with a totalized amount (Transaction code in record 21 starting with "1") followed by detailed transactions (Transaction code in record 21 starting with "5") are not parsed correctly. The parser treats the entire group and its detailed transactions as a single transaction, leading to the following issues:
Loss of individual transaction details.
Incorrectly concatenated transaction information.
Erroneous (structured-)message information due to concatenation of multiple transactions.
Solution
The changes in this pull request modify the parsing logic to:
Identify and ignore the globalized transaction if it is followed by its detailed transactions.
Ensure each detailed transaction is parsed and recorded individually, preserving the integrity of transaction information.
The totalized transaction is still provided in the list of transactions, but only if no detailed transactions are provided.
Impact
These changes ensure that grouped transactions are no longer incorrectly concatenated, and each detailed transaction retains its individual details, improving the accuracy of parsed transaction data.
Feel free to reach out if there are any questions or further clarifications needed.
Summary
This pull request addresses the issue reported in https://github.com/wimverstuyf/php-coda-parser/issues/29. The problem concerns to the incorrect parsing of grouped transactions with detailed transaction lines (e.g. SEPA transactions).
Problem Grouped transactions with a totalized amount (Transaction code in record 21 starting with "1") followed by detailed transactions (Transaction code in record 21 starting with "5") are not parsed correctly. The parser treats the entire group and its detailed transactions as a single transaction, leading to the following issues:
Solution The changes in this pull request modify the parsing logic to:
Impact These changes ensure that grouped transactions are no longer incorrectly concatenated, and each detailed transaction retains its individual details, improving the accuracy of parsed transaction data.
Feel free to reach out if there are any questions or further clarifications needed.
Thank you for reviewing this pull request.