pavolbiely / mrp

MRP invoices XML export

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MRP

Build Status Coverage Status

MRP invoices XML export.

Usage

Use composer to install this package.

$invoice = new Mrp\Invoice();
$invoice->addRow(['idfak' => 1, 'cislo' => '1201700001', 'ico' => '12345678', ...]);

$invoiceItem = new Mrp\InvoiceItem();
$invoiceItem->addRow(['idr' => 1, 'idfak' => 1, 'cenamj' => 50, ...]);
$invoiceItem->addRow(['idr' => 2, 'idfak' => 1, 'cenamj' => 200, ...]);

$address = new Mrp\Address();
$address->addRow(['idradr' => 1, 'firma' => 'Company', 'ico' => '11112222', ...]);

$bankAccount = new Mrp\BankAccount();
$bankAccount->addRow(['idr' => '1', 'idradr' => '1', ...]);

$zip = new ZipArchive();
if ($zip->open('export.zip', ZipArchive::CREATE) === true) {
	$zip->addFromString('mrp/FAKVY.XML', $invoice->getXml());
	$zip->addFromString('mrp/FAKVYPOL.XML', $invoiceItem->getXml());
	$zip->addFromString('mrp/FV_ADRES.XML', $address->getXml());
	$zip->addFromString('mrp/FV_ADRESBAN.XML', $bankAccount->getXml());
	$zip->close();
}

You can find input fields for addRow() method on MRP website. Please use all array keys as lowercase.

How to run tests?

Tests are build with Nette Tester. You can run it like this:

tester.bat -c php.ini-win --coverage coverage.html --coverage-src ../src

Minimum requirements

  • PHP 5.4+
  • ext-zip
  • ext-mbstring

License

MIT License (c) Pavol Biely

Read the provided LICENSE file for details.

About

MRP invoices XML export

License:MIT License


Languages

Language:PHP 99.4%Language:Batchfile 0.6%