PHP Classes
elePHPant
Icontem

Facturae PHP: Generate XML electronic bills paid in Spain

Recommend this page to a friend!
  Info   View files View files (22)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-04-28 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 103 All time: 8,950 This week: 387Up
Version License PHP version Categories
facturae-php 1.2.3Custom (specified...5XML, PHP 5, E-Commerce
Description Author
This package is specific mainly for applications used in Spain Spain .

This package can generate XML electronic bills paid in Spain.

It takes details about products or services paid in Spain and generates XML signed using a digital certificate for the electronic bill.

In Spanish:

Genera y firma facturas electrónicas en formato XML sin necesidad de ninguna librería adicional

Innovation Award
PHP Programming Innovation award nominee
September 2017
Number 6
Customer bills can be stored in files, so they can be exported by companies that emit bills for their customers, so they can imported on other systems that can process those bills.

This package generate electronic bills on XML format for use in Spain. They use digital certificates to sign the XML data, thus preventing tampering.

Manuel Lemos
  Performance   Level  
Name: José Miguel Moreno <contact>
Classes: 1 package by
Country: Spain Spain
Age: ???
All time rank: 4142112 in Spain Spain
Week rank: 748 Up24 in Spain Spain Up
Innovation award
Innovation award
Nominee: 1x

Details

Facturae-PHP

Travis Última versión Version de PHP Tamaño Licencia

Facturae-PHP es un paquete escrito puramente en PHP que permite generar facturas electrónicas siguiendo el formato estructurado Facturae e incluso añadirlas firma electrónica XAdES y sellado de tiempo sin necesidad de ninguna librería o clase adicional.

En apenas 25 líneas de código y con un tiempo de ejecución inferior a 0,4 µs es posible generar, firmar y exportar una factura electrónica totalmente válida:

$fac = new Facturae();
$fac->setNumber('FAC201804', '123');
$fac->setIssueDate('2018-04-01');

$fac->setSeller(new FacturaeParty([
  "taxNumber" => "A00000000",
  "name"      => "Perico de los Palotes S.A.",
  "address"   => "C/ Falsa, 123",
  "postCode"  => "123456",
  "town"      => "Madrid",
  "province"  => "Madrid"
]));
$fac->setBuyer(new FacturaeParty([
  "isLegalEntity" => false,
  "taxNumber"     => "00000000A",
  "name"          => "Antonio",
  "firstSurname"  => "García",
  "lastSurname"   => "Pérez",
  "address"       => "Avda. Mayor, 7",
  "postCode"      => "654321",
  "town"          => "Madrid",
  "province"      => "Madrid"
]));

$fac->addItem("Lámpara de pie", 20.14, 3, Facturae::TAX_IVA, 21);

$fac->sign("certificado.pfx", NULL, "passphrase");
$fac->export("mi-factura.xsig");

Requisitos

- PHP 5.6 o superior - OpenSSL (solo para firmar facturas)

Características

Documentación

Licencia

Facturae-PHP se encuentra bajo licencia MIT. Eso implica que puedes utilizar este paquete en cualquier proyecto (incluso con fines comerciales), siempre y cuando hagas referencia al uso y autoría de la misma.

  Files folder image Files  
File Role Description
Files folder imagedoc (7 files)
Files folder imagesrc (4 files)
Files folder imagetests (4 files)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  doc  
File Role Description
  Accessible without login Plain text file 01-introduccion.md Data Auxiliary data
  Accessible without login Plain text file 02-entidades.md Data Auxiliary data
  Accessible without login Plain text file 03-lineas-de-producto.md Data Auxiliary data
  Accessible without login Plain text file 04-propiedades.md Data Auxiliary data
  Accessible without login Plain text file 05-firma-electronica.md Data Auxiliary data
  Accessible without login Plain text file anexo.md Data Auxiliary data
  Accessible without login Plain text file otros-metodos.md Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file Facturae.php Class Class source
  Plain text file FacturaeCentre.php Class Class source
  Plain text file FacturaeItem.php Class Class source
  Plain text file FacturaeParty.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file InvoiceTest.php Class Class source
  Plain text file PerformanceTest.php Class Class source
  Accessible without login Plain text file private.pem Data Auxiliary data
  Accessible without login Plain text file public.pem Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:103
This week:0
All time:8,950
This week:387Up
User Comments (3)
Excelent work.
8 months ago (David Pascual)
77%StarStarStarStar
Excelent work.
8 months ago (David Pascual)
77%StarStarStarStar
Excelent work.
8 months ago (David Pascual)
77%StarStarStarStar