PHP code example of vineethkrishnan / xrechnung-kit-core

1. Go to this page and download the library: Download vineethkrishnan/xrechnung-kit-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vineethkrishnan / xrechnung-kit-core example snippets


use XrechnungKit\Builder\XRechnungBuilder;
use XrechnungKit\XRechnungGenerator;
use XrechnungKit\XRechnungValidator;

$mappingData = (new MyInvoiceMapper($invoice, $customer))->produce();

$entity = XRechnungBuilder::buildEntity($mappingData);
$generator = new XRechnungGenerator($entity);
$path = $generator->generateXRechnung('/path/to/Invoice_RE-1.xml');

$validator = new XRechnungValidator();
$ok = $validator->validate($path);