PHP Classes
elePHPant
Icontem

Facturae PHP: Generate XML electronic bills paid in Spain

Recommend this page to a friend!
  Info   View files View files (65)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-02-01 (6 months ago) RSS 2.0 feedNot enough user ratingsTotal: 125 All time: 8,982 This week: 354Up
Version License PHP version Categories
facturae-php 1.2.4Custom (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: 4159114 in Spain Spain
Week rank: 952 Up43 in Spain Spain Up
Innovation award
Innovation award
Nominee: 1x

 

Details

Facturae-PHP

Travis Codacy Coverage Última versión estable Licencia Documentación

Facturae-PHP es un paquete escrito puramente en PHP que permite generar facturas electrónicas siguiendo el formato estructurado Facturae, añadirlas firma electrónica XAdES y sellado de tiempo, e incluso enviarlas a FACe o FACeB2B 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"  => "12345",
  "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"      => "54321",
  "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) - cURL (solo para timestamping y FACe / FACeB2B) - libXML (solo para FACe y FACeB2B)

Características

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 (1 file, 8 directories)
Files folder imagesrc (5 files, 3 directories)
Files folder imagetests (9 files)
Accessible without login Plain text file .editorconfig Data Auxiliary data
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 CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file Gemfile 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
Accessible without login Plain text file _config.yml Data Auxiliary data

  Files folder image Files  /  doc  
File Role Description
Files folder imageanexos (4 files)
Files folder imageejemplos (4 files)
Files folder imageentidades (3 files)
Files folder imageenvio-y-recepcion (3 files)
Files folder imageextensiones (2 files)
Files folder imagefirma-electronica (2 files)
Files folder imageproductos (5 files)
Files folder imagepropiedades (6 files)
  Accessible without login Plain text file index.md Data Auxiliary data

  Files folder image Files  /  doc  /  anexos  
File Role Description
  Accessible without login Plain text file anexos.md Data Auxiliary data
  Accessible without login Plain text file constantes.md Data Auxiliary data
  Accessible without login Plain text file otros-metodos.md Data Auxiliary data
  Accessible without login Plain text file validacion.md Data Auxiliary data

  Files folder image Files  /  doc  /  ejemplos  
File Role Description
  Accessible without login Plain text file ejemplos.md Data Auxiliary data
  Accessible without login Plain text file envio-face.md Data Auxiliary data
  Accessible without login Plain text file factura-simple.md Data Auxiliary data
  Accessible without login Plain text file sin-composer.md Data Auxiliary data

  Files folder image Files  /  doc  /  entidades  
File Role Description
  Accessible without login Plain text file centros-administrativos.md Data Auxiliary data
  Accessible without login Plain text file compradores-y-vendedores.md Data Auxiliary data
  Accessible without login Plain text file entidades.md Data Auxiliary data

  Files folder image Files  /  doc  /  envio-y-recepcion  
File Role Description
  Accessible without login Plain text file envio-y-recepcion.md Data Auxiliary data
  Accessible without login Plain text file face.md Data Auxiliary data
  Accessible without login Plain text file faceb2b.md Data Auxiliary data

  Files folder image Files  /  doc  /  extensiones  
File Role Description
  Accessible without login Plain text file extensiones.md Data Auxiliary data
  Accessible without login Plain text file faceb2b.md Data Auxiliary data

  Files folder image Files  /  doc  /  firma-electronica  
File Role Description
  Accessible without login Plain text file firma-electronica.md Data Auxiliary data
  Accessible without login Plain text file sellado-de-tiempo.md Data Auxiliary data

  Files folder image Files  /  doc  /  productos  
File Role Description
  Accessible without login Plain text file campos-opcionales.md Data Auxiliary data
  Accessible without login Plain text file descuentos-y-cargos.md Data Auxiliary data
  Accessible without login Plain text file multiples-impuestos.md Data Auxiliary data
  Accessible without login Plain text file productos.md Data Auxiliary data
  Accessible without login Plain text file unidad-de-medida.md Data Auxiliary data

  Files folder image Files  /  doc  /  propiedades  
File Role Description
  Accessible without login Plain text file datos-del-pago.md Data Auxiliary data
  Accessible without login Plain text file descuentos-y-cargos.md Data Auxiliary data
  Accessible without login Plain text file propiedades.md Data Auxiliary data
  Accessible without login Plain text file referencias.md Data Auxiliary data
  Accessible without login Plain text file textos-literales.md Data Auxiliary data
  Accessible without login Plain text file version-de-facturae.md Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageCommon (2 files)
Files folder imageController (5 files, 1 directory)
Files folder imageFace (3 files)
  Plain text file Facturae.php Class Class source
  Plain text file FacturaeCentre.php Class Class source
  Plain text file FacturaeFile.php Class Class source
  Plain text file FacturaeItem.php Class Class source
  Plain text file FacturaeParty.php Class Class source

  Files folder image Files  /  src  /  Common  
File Role Description
  Plain text file KeyPairReader.php Class Class source
  Plain text file XmlTools.php Class Class source

  Files folder image Files  /  src  /  Controller  
File Role Description
Files folder imageExtensions (2 files)
  Plain text file FacturaeConstants.php Class Class source
  Plain text file FacturaeExportable.php Class Class source
  Plain text file FacturaeProperties.php Class Class source
  Plain text file FacturaeSignable.php Class Class source
  Plain text file FacturaeUtils.php Class Class source

  Files folder image Files  /  src  /  Controller  /  Extensions  
File Role Description
  Plain text file Extension.php Class Class source
  Plain text file Fb2bExtension.php Class Class source

  Files folder image Files  /  src  /  Face  
File Role Description
  Plain text file Faceb2bClient.php Class Class source
  Plain text file FaceClient.php Class Class source
  Plain text file SoapClient.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file DecimalsTest.php Class Class source
  Plain text file DiscountsTest.php Class Class source
  Plain text file ExtensionsTest.php Class Class source
  Plain text file InvoiceTest.php Class Class source
  Plain text file MethodsTest.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
  Plain text file WebservicesTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:125
This week:0
All time:8,982
This week:354Up
User Comments (3)
Excelent work.
1 year ago (David Pascual)
77%StarStarStarStar
Excelent work.
1 year ago (David Pascual)
77%StarStarStarStar
Excelent work.
1 year ago (David Pascual)
77%StarStarStarStar