stephenharris / phpqif
一个用于编写QIF文件的简单PHP库
0.1.0
2017-06-28 20:36 UTC
Requires (Dev)
- phpunit/phpunit: 5.7
This package is not auto-updated.
Last update: 2024-09-24 17:56:07 UTC
README
一个远未完善的用于在PHP中编写QIF文件的库。
安装
composer require stephenharris/phpqif
使用
写入器
// Instatiate the QIF Writer $qif = new StephenHarris\QIF\Writer(); // Create a new transaction $transaction = new Transaction( Transaction::CASH ); $transaction->setDate( new \DateTime( '2017-12-31' ) ) ->setDescription( 'invoice-123: Some Payment' ) ->setAmount( 68.99 ) ->setCategory( 'Sales' ) ->addSplit( 'Sales', 60 ) ->addSplit( 'Fee', -3.01 ) ->addSplit( 'Tax', 12 ) ->markReconciled(); // Add it to the QIF $qif->addTransaction( $transaction ); echo $qif;
解析器
// Instatiate the QIF Writer $qifParser = new StephenHarris\QIF\Parser( $filePath ); $qifParser->parse(); foreach( $qifParser->getTransactions() as $transaction ) { // your code }