wimverstuyf / php-coda-parser Goto Github PK
View Code? Open in Web Editor NEWPHP parser for Belgian CODA banking files
License: GNU Lesser General Public License v3.0
PHP parser for Belgian CODA banking files
License: GNU Lesser General Public License v3.0
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.
I would like to get the address from line 32 s.
How can I get that?
To be able to detect duplicate database entries, I need to check if a coda/transaction was already inserted (based on its sequence number). Since the sequence numbers were read/parsed, but not exposed to the transaction, I added these.
https://github.com/wimverstuyf/php-coda-parser/pull/16
Hello,
you should add a tag version number to this libs.
If possible by respecting http://semver.org/
For legal purposes LGPL is better licence for using this code in proprietary software.
Hello,
I started yesterday to use your library, it works very well except for records using sequence number details. All the transactions are linked to the sequence numbers and the sequence number details are not taken into account.
so if I have in the coda file 4 transactions, the 2 first ones having the same sequence number but different sequence number details and the 2 other ones having different sequence numbers:
2100010000...
2200010000...
2300010000...
3100010000...
2100010001...
2200010001...
2300010001...
3100010001...
2100020000...
2200020000...
2300020000...
3100020000...
2100030000...
2200030000...
2300030000...
3100030000...
When I parse the file, only 3 transactions are found:
Are you already aware of this issue?
This evening I tried to quickly fix it by adding a transactionSequenceDetail to the Transaction class. Then in StatementParser class in function groupTransactions I use it to increment $idx. The result looks good but I still have to check if there is no side effect. Do you think it's a good way to fix it?
Best Regards,
Patrice Devemy
The coda parser has an issue parsing coda files like these:
2100040000310N019418263001137 0000000017233540310517001500000Europese overschrijving (zie bijlage) 31051710101 0
2200040000 + 17.233,54Van: COMPANY BLABLABLAH BVBA - BE64NOT PROVIDED BBRUBEBB 1 0
2300040000BE34359648312345 EURCOMPANY BLABLABLAH BVBA 363120669252 0 1
3100040001310N019418263001137 001500001001COMPANY BLABLABLAH BVBA 1 0
3200040001STRAATSTREEEEEET 123 1111 PLACE 0 1
3100040002310N019418263001137 001500000Europese overschrijving Van: COMPANY BLABLABLAH BVBA STRAATSTREEEEEET 123 0 1
3100040003310N019418263001137 001500000 1111 PLACE Belgie IBAN: BE34359648312349 0 0
As you can see, it has multiple 31 lines and the coda parser is only outputting the last 31 line. All data in previous 31 lines are missing and in some cases those contain important data in order to link the transaction to a customer.
So, the message with this transaction would only be "1111 PLACE Belgie IBAN: BE34359648312349" while it should be "Europese overschrijving Van: COMPANY BLABLABLAH BVBA STRAATSTREEEEEET 123 1111 PLACE Belgie IBAN: BE34359648312349" ...
For testing purposes I'm now using the "raw" output, and replaced this line in the parser:
$current_account_transaction->transactions[$trans_idx]->{'line'.$coda_line->record_code.$coda_line->article_code} = $coda_line;
with:
$current_account_transaction->transactions[$trans_idx]->{'line'.$coda_line->record_code.$coda_line->article_code.intval($coda_line->sequence_number_detail)} = $coda_line;
THIS IS NOT A FIX! It's just a work around to make it work with the "raw" output so that I can get things done with this coda parser library. It's certainly breaking the "simple" output.
Hello,
I use your parser for an app used in intern and I found a bug when a transaction is regarding a credit repayment operation (in my case VISA or simple Bank credit). It appears that the parser returns many "21" operations (which is ok regarding CODA specs at https://www.febelfin.be/sites/default/files/Standard-CODA-2.3-FR.pdf), but when parsed, only the last operation "21" is returned when the first was expected (the one with "sequence_number_detail" prop == 0000).
To fix that in my app I simply added a condition in Parser.php before the line 156, so the code looks like this:
if( $coda_line->sequence_number_detail == '0000' )
$current_account_transaction->transactions[$trans_idx]->{'line'.$coda_line->record_code.$coda_line->article_code} = $coda_line;
Don't know if all coda transactions will work with this "fix" but in my case that does the job.
Thanks for the great work !
Hi Wim,
Recently, i discovered that not all my coda files were processed from the first time. Sometimes, I'm getting the following error:
Exception: Could not parse in /var/www/app/releases/302/vendor/codelicious/php-coda-parser/src/LinesParser.php:56
with the stack trace:
#0 /var/www/app/releases/302/vendor/codelicious/php-coda-parser/src/LinesParser.php(30): Codelicious\Coda\LinesParser->parse() #1 /var/www/app/releases/302/vendor/codelicious/php-coda-parser/src/Parser.php(31): Codelicious\Coda\LinesParser->parseFile() #2 /var/www/app/releases/302/app/Models/CodaFile.php(171): Codelicious\Coda\Parser->parseFile() #3 /var/www/app/releases/302/app/Jobs/Coda/ProcessCodaFile.php(54): App\Models\CodaFile->read()
It seems that the coda file could not be read, but when processing it for a second time, it just works perfectly. Any idea what the issue could be here? If needed, I can provide an anonymised version of the file. This only happened about 20 times in more than 5.000 coda files.
PS: I'm using this package for a while now and never encountered real issues. 🎉
Kind regards,
Arno
Hello,
i've this error.
Can you help me ?
Parse error: syntax error, unexpected ')' in /var/www/indigona/logi_print/vendor/codelicious/php-coda-parser/src/StatementParsers/TransactionParser.php on line 108
thanks
Hello,
I am searching for a coda parser in .NET. Your package is the only clear and understandable one that I have found.
Is it possible that I port your code to C# and place a link back to this project?
I will try to keep following updates in your project and replicate them in my project and raise issues for your code if some in my code arrive.
Bij een collectieve overschrijving is het onmogelijk om de detail / sub transacties van een groep uit te lezen (zie voorbeeld):
Febelfin codering:
Type: 1
Family: 01
Operation: 07
Huidige situatie:
Gewenste situatie (voorstel 1):
Gewenste situatie (voorstel 2):
Wat is uw mening hieromtrent? Wat lijkt het beste voorstel om dit op te lossen?
Wij kunnen dit implementeren, maar willen toch graag eerst eens polsen.
Voorbeeld:
0000011101772505 00265207 BOUWBEDRIJF VOOR GROTE WERKREDBEBB 00330158420 00000 2
10139138536152215 EUR0BE 0000000017752120101017BOUWBEDRIJF VOOR GROTE WERKBC-Bedrijfsrekening 138
21000100000801A3T033523 1000000000085000290322101070000creditTran/0000 29032203411 0
2200010000 p24t20220328122212c1 0 1
31000100010801A3T033523 101070000UITVOERING VAN UW BESTAND/GROEP creditTran/0000 0 0
2100010002KLIM03284DSCICDEVATVA1000000000025000111017001500001101000003515846 11101713901 0
2200010002 BBRUBEBB 1 0
2300010002BE25646548413215 KLANT2 NAAM2 0 1
3100010002KLIM03284DSCICDEVATVA001500001001KLANT2 NAAM2 1 0
3200010002VOETGANGERSTRAAT 26 1215 ANTWERPEN 0 0
2100010003OL69IXSTASSCCOXSOVDGS1000000000020000111017001500001101000003154982 11101713901 0
2200010003 KREDBEBB 1 0
2300010003BE32135468465432 KLANT3 NAAM 0 1
3100010003OL69IXSTASSCCOXSOVDGS001500001001KLANT3 NAAM 1 0
3200010003KLEIN WEGELKEN 1 8423 LEUVEN 0 0
2100010004KACS00321DSCTIXEIKDVA1000000000030000111017001500001101000002133131 11101713901 0
2200010004 GEBABEBB 1 0
2300010004BE23156453132168 KLANT4 - NAAM4 MET 0 1
3100010004KACS00321DSCTIXEIKDVA001500001001KLANT4 - NAAM4 MET 1 0
3200010004EIKENSTRAAT 25 2141 BRUGGE 0 0
8139138536152215 EUR0BE 0000000017832120111017 0
9 000022000000000000000000000000080000 1
Hello,
In our case, the bank statements sent by BPost bank do not fully comply with the CODA standard.
For the "account structure" field, in data record 1, at position 2. This field must take a value from 0 to 3. But in our account statements, this field is empty. So, the account information are'nt analysed.
It will be a good thing to provide final else in the function: account.addAccountInfo () in case of a empty $accountType.
Hi,
First of all many thx for this useful package.
I noticed that the ING CODA files are having lines with 130 characters instead of 128 which then throws a fatal exception in the parser.
By "trimming" the line, the issue is solved (I added the trim in the function Parse of the class LinesParser.php).
foreach($codaLines as $line) {
if (!empty($line)) {
/** @var LineInterface|null $lineObject */
$lineObject = null;
$line = trim($line);
Thank you.
Sélim
What is the version of CODA files that this library handle ? as I see the CODA code that exists in /tests/ParserTest.php ( getSample1() ) method ) is different a lot from the documentation of CODA version 2.3 and version 2.5b (Ex.. EUR and BE in record type 1 and 8)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.