condividendo / laravel-fatturapa
v0.2.0
2022-12-08 14:46 UTC
Requires
- php: ^7.2
- ext-dom: *
- ext-simplexml: *
- bensampo/laravel-enum: 1.*
- brick/math: >=0.6
- illuminate/support: 5.8.*
Requires (Dev)
- orchestra/testbench: ^3.8
- phpstan/phpstan: 1.4.*
- slevomat/coding-standard: ^8.6
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2025-03-08 20:09:38 UTC
README
This package allows you to generate the XML of Italian eInvoice (aka FatturaPA).
Useful links:
Installation
composer require condividendo/laravel-fatturapa
Usage
$invoice = \Condividendo\FatturaPA\FatturaPA::build() ->senderId('IT', '01879020517') ->transmissionFormat(\Condividendo\FatturaPA\Enums\TransmissionFormat::FPR12()) ->transmissionSequence('1') ->recipientCode('ABC1234') ->supplier( \Condividendo\FatturaPA\Entities\Supplier::make() ->companyName('Condividendo italia srl') ->vatNumber('IT12345640962') ->taxRegime(\Condividendo\FatturaPA\Enums\TaxRegime::RF01()) ->address( \Condividendo\FatturaPA\Entities\Address::make() ->addressLine('Via Italia, 123') ->postalCode('12345') ->city('Milano') ->province('MI') ->country('IT') ) ) ->customer( \Condividendo\FatturaPA\Entities\Customer::make() ->firstName('Mario') ->lastName('Rossi') ->fiscalCode('RSSMRA73L09Z103F') ->address( \Condividendo\FatturaPA\Entities\Address::make() ->addressLine('Via Italia, 123') ->postalCode('12345') ->city('Milano') ->province('MI') ->country('IT') ) ) ->addBody( \Condividendo\FatturaPA\Entities\Body::make() ->type(\Condividendo\FatturaPA\Enums\Type::TD01()) ->currency('EUR') ->number('1') ->items([ \Condividendo\FatturaPA\Entities\Item::make() ->number(1) ->description('Product description') ->price('10.00') ->taxRate('0.22') ]) ->summaryItems([ \Condividendo\FatturaPA\Entities\SummaryItem::make() ->taxableAmount('10.00') ->taxRate('0.22') ]) ); /** @var \SimpleXMLElement $xml */ $xml = $invoice->toXML(); // do whatever you want with $xml variable...
Changelog
Please see Changelog File for more information on what has changed recently.
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.