stephenharris / phpqif
A simple PHP library for writing QIF files
Installs: 7 542
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 4
Open Issues: 2
Requires (Dev)
- phpunit/phpunit: 5.7
This package is not auto-updated.
Last update: 2024-11-19 19:07:07 UTC
README
A far from feature complete library for writing QIF files in PHP.
Installation
composer require stephenharris/phpqif
Usage
Writer
// 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;
Parser
// Instatiate the QIF Writer $qifParser = new StephenHarris\QIF\Parser( $filePath ); $qifParser->parse(); foreach( $qifParser->getTransactions() as $transaction ) { // your code }