codelicious/php-belgianbankstatement-parser
最新稳定版本:v2.5.0
Composer 安装命令:
composer require codelicious/php-belgianbankstatement-parser
包简介
Unified parser for several bank statement formats from Belgian banks
README 文档
README
Unified parser for several bank statement formats from Belgian banks. Supports CODA, MT940 and CSV (BNP Paribas / Belfius / KBC / ING / Crelan / Triodos)
Installation
You can install Codelicious/BelgianBankStatement using Composer. You can read more about Composer and its main repository at
http://packagist.org. First install Composer for your project using the instructions on the
Packagist home page, then define your dependency on Codelicious/BelgianBankStatement in your composer.json file.
{
"require": {
"codelicious/php-belgianbankstatement-parser": "^2.0"
}
}
Or you can execute the following command in your project root to install this library:
composer require codelicious/php-belgianbankstatement-parser
Usage
<?php use Codelicious\BelgianBankStatement; $parser = new Parser(); $statement = $parser->parseFile('coda-file.cod', 'coda'); echo $statement->getDate()->format('Y-m-d') . "\n"; foreach ($statement->getTransactions() as $transaction) { echo $transaction->getAccount()->getName() . ": " . $transaction->getAmount() . "\n"; } echo $statement->newBalance() . "\n";
Encoding considerations
It's possible that non UTF-8 characters are present in the statements. In order to unify the encoding of your ingested statements, you might want to consider converting the encoding to UTF-8 before parsing.
if (mb_detect_encoding($content, ['UTF-8', 'ISO-8859-1']) === 'ISO-8859-1') { // use mb_convert_encoding($content, to_encoding, from_encoding) to convert to UTF-8 $content = mb_convert_encoding($content, "UTF-8", "ISO-8859-1"); }
Statement structure
Codelicious\BelgianBankStatement\StatementDate- Date of the supplied file (format YYYY-MM-DD)Account- Account for which the statements were created. An object implementingCodelicious\BelgianBankStatement\AccountInitialBalance- Balance of the account before the transactions were processed. Up to 3 decimals.NewBalance- Balance of the account after the transactions were processed. Up to 3 decimals.Transactions- A list of transactions implemented asCodelicious\BelgianBankStatement\Transaction
Codelicious\BelgianBankStatement\AccountName- Name of the holder of the accountBic- Bankcode of the accountNumber- Banknumber of the accountCurrencyCode- Currency of the accountCountryCode- Country of the account
Codelicious\BelgianBankStatement\TransactionAccount- Account of the other party of the transaction. An object implementingCodelicious\BelgianBankStatement\AccountTransactionDate- Date on which the transaction was requestedValutaDate- Date on which the transaction was executed by the bankAmount- Amount of the transaction. Up to 3 decimals. A negative number for credit transactions.Message- Message of the transactionStructuredMessage- Structured messages of the transaction (if available)
统计信息
- 总下载量: 10.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2015-03-13