1. Go to this page and download the library: Download absabbath/factura-digital 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/ */
$receptor = FacturaDigital::receptor()
->setRfc('NDI120326HF5')
->setNombre('Novatech Digital SA de CV')
//->setNumRegIdTrib('')
->setUsoCFDI('G03')
->setCalle('Palmas')
->setNoExt('129')
->setColonia('Centro')
->setMunicipio('Guadalupe')
->setEstado('Nuevo León')
->setPais('Mexico')
->setCodigoPostal('98000')
->getData();
$concepto = \FacturaDigital::concepto()
->setClaveProdServ('01010101') // Agregar clave sat en catalogo productos
->setNoIdentificacion('1') // Id interno
->setCantidad(5) // Cantidad a facturar
->setClaveUnidad('LTR') // Clave del SAT
->setUnidad('Litro') // Descripcion unidad
->setDescripcion('Descripcion/nombre del producto')
->setValorUnitario(30); // Costo por unidad
$impuestos = []; // Recolecta la informacion de todos los impuestos
$impuesto_iva = \FacturaDigital::conceptoImpuesto()
->setBase(30) // Base gravable
->setImpuesto('002')
->setTipoFactor('Tasa')
->setTasaOCuota(0.16000)
->setImporte(30 * 0.16000) // Base gravable X tasaocuota
->getData();