pittacusw/parse-bill is a Laravel package for wrapper to parse xml bills and generate a pdf file.
It currently has 0 GitHub stars and 101 downloads on Packagist (latest version v2).
Install it with composer require pittacusw/parse-bill.
Discover more Laravel packages by pittacusw
or browse all Laravel packages to compare alternatives.
Last updated
Laravel package for parsing Chilean DTE XML documents and rendering them as PDF files.
The package is designed around the existing printable layout used by this project. The PDF view contract has been kept intact during the optimization pass so margins, page structure, cedible copy rules, and the legal layout behavior continue to follow the current implementation.
Documento payload into a PHP object structure that the Blade views can renderbarryvdh/laravel-dompdf^8.3^13.2composer require pittacusw/parse-bill
Publish the package assets and run the migrations:
php artisan vendor:publish --provider="Pittacusw\ParseBill\ParseBillServiceProvider"
php artisan migrate
The PDF renderer expects lookup data for:
Seed the required tables with the included seeders:
php artisan db:seed --class="Pittacusw\ParseBill\Seeders\SiiBranchesTableSeeder"
php artisan db:seed --class="Pittacusw\ParseBill\Seeders\CountiesTableSeeder"
php artisan db:seed --class="Pittacusw\ParseBill\Seeders\DocumentsTypesTableSeeder"
php artisan db:seed --class="Pittacusw\ParseBill\Seeders\AdditionalTaxesTableSeeder"
Optional seeders are also available for economic activities, reference types, and transfer types.
After publishing, the package config file is available at config/pittacusw-parse-bill.php.
By default it points to these models:
return [
'county' => \Pittacusw\ParseBill\Models\County::class,
'documents_type' => \Pittacusw\ParseBill\Models\DocumentsType::class,
'additional_tax' => \Pittacusw\ParseBill\Models\AdditionalTax::class,
];
Override these entries if your application uses custom models for the same tables.
use Pittacusw\ParseBill\ReadXml;
$document = ReadXml::parse($xmlOrPath);
$xmlOrPath can be:
The parser normalizes single Detalle, Referencia, DscRcgGlobal, and ImptoReten nodes into arrays so the renderer can iterate them consistently.
use Pittacusw\ParseBill\ReadXml;
$signature = ReadXml::signature($xmlOrPath);
use Pittacusw\ParseBill\ParsePdf;
$pdf = ParsePdf::render($xmlOrPath);
return $pdf->stream('documento.pdf');
You can also save or return the binary output:
$contents = ParsePdf::render($xmlOrPath)->output();
This package intentionally preserves the current visual PDF structure:
33, 34, and 52 is preservedIf you need to change layout rules for another legal regime or document standard, do it through dedicated view changes and add fixture-based tests before shipping.
The package now includes a PHPUnit + Testbench suite covering:
SetDTE and direct Documento rootsRun the suite with:
composer test
TED node and on the barcode library being available in the runtime environment.