CfdiUtils Changelog file
Backward compatibility breaks (not released yet), plan for version 4.0
- Refactor
\CfdiUtils\Certificado\SerialNumberto be immutable, this change will remove methods:loadHexadecimal,loadDecimalandloadAscii. - Fix/improve
ElementsMakerstandard. - Remove code to build CFDI 3.3.
Maintenance 2026-03-17
Remove curl_close() function call since it has no effect since PHP 8.0.
This changes apply to GitHub Workflows:
- Run build jobs using PHP 8.5.
- Run SonarQube Cloud jobs using PHP 8.4 due
genkgo/xslincompatibility. - List missing actions/setup-java@v5 action.
- Modernize SonarQube Cloud integration.
Version 3.0.2 2026-03-17
- Update license year.
- Fix some typos on validator messages.
- Ensure compatibility with PHP 8.5.
- Fix some types that were forces using PHP document blocks.
Other development changes:
- Allow to install
genkgo/xslon PHP 8.4. - Disallow to install
genkgo/xslon PHP 8.5 due library is not compatible. - Use
nosborn/github-action-markdown-cli@v3action. - Fix configuration file for
php-cs-fixer. - Define
$argvon CLI script to satisfy PHPStan. - Fix how SaxonHE is installed on Windows.
- Add PHP 8.5 to test matrix.
- Update development tools.
Version 3.0.1 2025-06-24
Add S A P I DE CV to RegimenCapitalRemover.
This should be an error from SAT when creates the certificate 00001000000710061506, but we have deal with it.
Fix a bug when write Pagos taxes summary.
It was writing TasaOCuotaP when TipoFactorP is Exento.
It now does not write that attribute as in ImporteP.
Thanks @jiagbrody (discord) for noticing this issue.
Version 3.0.0 2025-03-18
This is a major release primary for compatibility to PHP 8.4. It also drops compatibility with PHP 7.3 and PHP 7.4. Read and follow the guide Actualizar a versión 3.x (in spanish).
Add this project to SonarCloud. Thanks Scrutinizer.
Version 2.31.0 2025-02-19
A new utility CfdiUtils\Utils\RegimenCapitalRemover has been created to remove the Régimen de Capital
from a string. The most common case is to remove it from a certificate name, but you can use it anywhere.
This release includes a change to Certificado::getName() method.
The argument $trimSuffix was added, with default false.
When you pass $trimSuffix: true, it will try to remove the Régimen de capital suffix from the
name detected on the certificate. For example: EMPRESA PATITO SA DE CV will return EMPRESA PATITO.
The method CfdiCreator40::putCertificado() now evaluates if the certificate belongs to a Persona Moral,
and the root node has attribute Version equal to 4.0.
If that is the case then it will set up the Emisor@Name attribute removing the suffix.
That means that is no longer necessary to override the Emisor@Name later.
The assertion SELLO04: El nombre del emisor del comprobante es igual al encontrado en el certificado
has been changed, previously, if the RFC belongs to a Persona Moral then it returns status none.
Now, the assertion uses the "remove the Régimen de capital" capability to perform the validation.
Thanks @ahuahuachi for the contribution.
Version 2.30.0 2025-02-14
This is a maintenance release to fix continuous integration.
- Fix
symfony/processrequirement versions to improve security. - Update license year to 2025.
- Upgrade to PHPStan 2.1 and fix/ignore new issues.
- Avoid PHP 8.4 due deprecation messages.
- Remove code to avoid testing genkgo/xsl on PHP 8.3.
Version 2.29.0 2024-06-18
Add CfdiUtils\Elements\CartaPorte31 Elements to work with "Carta Porte 3.1".
Thanks @alejandrogova1 for your contribution.
Version 2.28.2 2024-06-09
- Wrap OpenSSL command run on a try/catch block to throw an
OpenSSLExceptionexception. - Refactor certificate downloader test helper. Now it uses curl instead of native PHP. It was failing on PHP 7.3.
- Remove old dependencies for ReadTheDocs:
mkdocs:1.2.3andjinja2<3.1.0. Thanks to@dependabot. - On build workflow:
- Simplify "on" section.
- Use
php-versionmatrix value as singular.
Version 2.28.1 2024-02-20
- Allow dependency on
symfony/processbranch7.x. - Migrate GitHub actions to version 4.
Version 2.28.0 2024-01-22
- Deprecate
CfdiUtils\Utils\Crp20277Fixersince SAT changed the ruleCRP20277. - Fix code style (use same case for
XsltProcessor). - Run GitHub jobs using PHP 8.3.
Version 2.27.1 2024-01-12
- Add Complemento Comercio Exterior 2.0 documentation.
- Fix
CHANGELOGfor2.26.0: it was saying that CCE had version 3.0 when it was 2.0.
Version 2.27.0 2024-01-12
Add CfdiUtils\Utils\Crp20277Fixer to work with new rule CRP20277 (apply since 2024-01-15).
Version 2.26.0 2024-01-10
Add CfdiUtils\Elements\Cce20 Elements to work with "Complemento de Comercio Exterior 2.0".
Extract logic to move SAT definitions to root element to a helper in order to use it on other creators:
- Add
SatNsDefinitionsMoverhelper. - Change
CfdiCreatorTrait::moveSatDefinitionsToComprobanteto use helper. - Add
RetencionesCreatorTrait::moveSatDefinitionsToRetenciones. - Document samples using
$creator->moveSatDefinitionsToRetenciones(). - Fix tests sample files with sat definitions on root element.
Unreleased 2024-01-08
- Fix continuous integration code style.
- Update license year. Happy 2024!
- Add PHP 8.3 to test matrix on Linux and Windows.
- Remove
genkgo/xslon PHP 8.3 since it is not compatible yet.
Unreleased 2023-10-30
Fix continuous integration: php-cs-fixer:3.37.1 fixes.
Version 2.25.0 2023-10-22
Add CfdiUtils\Elements\CartaPorte30 Elements to work with "Carta Porte 3.0".
Thanks @alejandrogova1 for your contribution.
Version 2.24.1 2023-07-12
Fix calculator for complement Pagos 2.0.
For attributes BaseP and ImporteP the value was truncated. Now, the value has to be rounded.
Some vendors communicate this change, such as Finkok.
Improve calculator with new getter and setter for paymentTaxesPrecision and currencies.
Update code style as other PhpCfdi projects.
Set up PHPStan paths on configuration file.
Maintenance 2023-06-19
The certificate for RFC EKU9003173C9 expired and is replaced for a new one.
This change require several changes on tests.
Replace deprecated rule single_blank_line_before_namespace with blank_lines_before_namespace for php-cs-fixer.
Version 2.24.0 2023-06-14
Add a calculator and writer for complement Pagos 2.0.
This tool takes a Pre-CFDI elements to write Pagos\Totales, Pagos\Pago[]\ImpuestosP
and (if not found) Pagos\Pago[]@Monto. This feature is also documented.
Make SOAP extension requirement optional.
- Add element helpers for complement Servicios parciales de construcción 1.0.
- Add element helpers for complement Consumo de combustibles 1.1.
- Add element helpers for complement Donatarias 1.1.
- Add element helpers for complement Instituciones educativas privadas 1.0.
- Add element helpers for complement INE 1.1.
- Add element helpers for complement Leyendas Fiscales 1.0.
- Add element helpers for complement Notarios Públicos 1.0.
Thanks @BlakePro for the initial work on these improvements.
Changes on development environment and documentation:
- Move CFDI creation from 3.3 to 4.0.
- Review all files and fix almost all typos and phrasing errors, thanks PhpStorm.
- Add usage of phpcfdi/credentials.
- Add support for PHP 8.2 on README.md
- Remove GitHub code language detection on
tests/assets/. - Update
markdownlint-clitool. - Fix issues found by
markdownlint-cli.
Version 2.23.5 2023-05-25
- Fix
SELLO04false positives on CFDI 4.0.- If name is empty then status is error since it is mandatory.
- If Persona Moral then status is none since it is not possible to compare names.
- If Persona Física then status is ok when name is identical to certificate name.
- Improve
SUMAS07explanation. - Fix PHPStan false positives.
- Update license year.
- Update
php-cs-fixerconfiguration file. - Fix
genkgo/xsldependency version. - GitHub Workflow:
- Add PHP 8.2 to test matrix.
- Jobs run in PHP 8.2.
- Remove development tools before install project dependencies.
- Fix build badge.
- When testing using Genkgo, ignore deprecation errors.
- Replace
utf8_decodecalls withmb_convert_encoding.
Version 2.23.4 2022-12-07
This is a maintenance release to fix the continuous integration workflow and append pending development changes.
- Fix test
CertificadoTest::testConstructWithValidExample()to allow quoted slashes on name. - Add phpdoc to the method
Certificate::getCertificateName(). The value can contain quoted slashes\/depending on the OpenSSL version. - Update script
tests/validate.phpto validate CFDI 3.3 or CFDI 4.0. - Add return types to some methods:
Status::comparableValueandStatus::__toString.Discoverer::discoverInFile.
- Improve
TestCase::installCertificate(): It doesn't depend on the certificate's file name to install correctly. - Update GitHub build workflow:
- Update GH Workflows: Remove deprecated
::set-output&::save-state. - Split full build actions to individual jobs.
- Split Windows and Linux testing.
- Update GH Workflows: Remove deprecated
Version 2.23.3 2022-08-11
Fix CFDI 4.0, must include Comprobante/Impuestos/Traslados/Traslado@TipoFactor=Exento when exists at least one
node Comprobante/Conceptos/Concepto/Impuestos/Traslados/Traslado@TipoFactor=Exento.
The node must contain attribute TipoFactor=Exento and the rounded sum of the attributes Base
grouped by attribute Impuesto.
Thanks BrodyAG for noticing this issue, and @yairtestas for your guidance to find the solution.
Version 2.23.2 2022-06-29
Use Symfony/Process instead of ShellExec.
Remove internal classes ShellExec and ShellExecResult.
Rename internal class ShellExecTemplate to CommandTemplate.
Version 2.23.1 2022-06-20
Fix hardcoded Regímenes catalog to fix CFDI33 validation EmisorRegimenFiscal.
Thanks @celli33 for your contribution.
Version 2.23.0 2022-06-15
Add CfdiUtils\Elements\PlataformasTecnologicas10 Elements to work with "Complemento Servicios de Plataformas Tecnológicas".
Thanks @gam04 for your contribution.
Version 2.22.0 2022-05-15
Add support to read and create a RET 2.0 (Retenciones e información de pagos 2.0) document.
- Add helper elements on namespace
CfdiUtils\Elements\Retenciones20. - Add
CfdiUtils\Retenciones\RetencionVersion. - Add
CfdiUtils\Retenciones\RetencionesCreator20. - Move shared methods from
CfdiUtils\Retenciones\RetencionesCreator10toCfdiUtils\Retenciones\RetencionesCreatorTrait. - Refactor
CfdiUtils\Retenciones\Retencionesto read versions 1.0 and 2.0. - Improve documentation about RET 2.0.
Thanks @gam04 for your contribution.
Version 2.21.0 2022-04-29
- Introduce
\CfdiUtils\Nodes\NodeHasValueInterfaceto work with nodes simple text content. - The class
\CfdiUtils\Nodes\Nodeimplements\CfdiUtils\Nodes\NodeHasValueInterface. - The XML node importers and exporters now can read and write simple text content.
Version 2.20.2 2022-04-05
Allow installing Genkgo/Xsl version 1.1.0; used for PHP >= 7.4.
Test: Fix test that was overriding retenciones/sample-before-tfd.xml file.
Include the following unreleased changes
2022-03-18
Fix build since GitHub Action sudo-bot/action-scrutinizer is failing.
Use scrutinizer/ocular package instead.
Test: When creating a pago, use addSumasConceptos to populate SubTotal and Total.
CI: Always run apt-get update before apt-get install.
Version 2.20.1 2022-03-08
Add PHP 8.1 minimal compatibility.
Skip tests on GenkgoXslBuilderTest because the library genkgo/xsl is not compatible with PHP 8.1.
Skip tests WebServiceConsumingTest::testSoapClientHasSettings because cannot access SoapClient private properties.
Add dependence on symfony/process to include 6.0. This allows to install the library on PHP 8.1.
Upgrade eclipxe/xmlschemavalidator from version 2.x to version 3.x (fully PHP 8.1 compatible).
Add #[\ReturnTypeWillChange] or fix return types on implemented classes like
IteratorAggregate::getIterator(): Traversable.
Add information about how tu run locally GitHub Actions using nektos/act tool.
Version 2.20.0 2022-02-22
Add CfdiUtils\Elements\Pagos20 Elements to work with "Complemento para recepción de Pagos 2.0".
Thanks @EmmanuelJCS.
Version 2.19.1 2022-02-09
Fix EmisorRegimenFiscal validation. Add 626 - RESICO. Thanks @celli33.
The following changes apply only to development and has been applied to main branch.
- Removed duplicated assert in Comprobante #84.
- Added new regimen 626 in validator for EmisorRegimenFiscal class.
Version 2.19.0 2022-01-17
Add CFDI 4.0 compatibility: read, validate and create:
CfdiUtils\Cfdiobject now can read CFDI 4.0.CfdiUtils\CfdiValidator40object was introduced to validate CFDI 4.0 with only the following validations:- The document follows de CFDI 4.0 specification (namespace, root element prefix and name).
- The document follows de CFDI 4.0 schema.
- The document has a valid
NoCertificado,CertificadoandSello. - The document has a valid
TimbreFiscalDigitaland information matches withcfdi:Comprobante@Sello.
CfdiUtils\CfdiCreator40object was introduced to create CFDI 4.0.- The helper elements
CfdiUtils\Elements\Cfdi40were created. - Add minimal documentation to read, validate and create CFDI 4.0.
The following are development details:
- Created
\CfdiUtils\Validate\Xml\XmlFollowSchemaas a standard validator, it does not depend on the type of CFDI. - The validator
CfdiUtils\Validate\Cfdi33\Xml\XmlFollowSchemais now an extended class of\CfdiUtils\Validate\Xml\XmlFollowSchema. The class is also deprecated. - Add
CfdiUtils\Certificado::getPemContentsOneLine(). - Add CFDI 4.0 information to:
CfdiUtils\CadenaOrigen\CfdiDefaultLocations.CfdiUtils\Certificado\NodeCertificado.CfdiUtils\CfdiVersion.
- Deprecate
CfdiUtils\Cfdi::CFDI_NAMESPACE. - Add
CfdiUtils\CfdiCreateObjectExceptionthat contains all the failures when try to construct aCfdiUtils\Cfdiobject. - Extract and share logic for several objects that are CFDI 3.3 and CFDI 4.0 compatible:
CfdiUtils\CfdiValidator33toCfdiUtils\Validate\CfdiValidatorTrait.CfdiUtils\Validate\Cfdi33\Standard\SelloDigitalCertificadotoCfdiUtils\Validate\Common\SelloDigitalCertificadoValidatorTrait.CfdiUtils\Validate\Cfdi33\Standard\TimbreFiscalDigitalSellotoCfdiUtils\Validate\Common\TimbreFiscalDigitalSelloValidatorTrait.CfdiUtils\Validate\Cfdi33\Standard\TimbreFiscalDigitalVersiontoCfdiUtils\Validate\Common\TimbreFiscalDigitalVersionValidatorTrait.CfdiUtils\CfdiCreator33toCfdiUtils\Validate\CfdiCreatorTrait.CfdiUtils\Elements\Cfdi33\Helpers\SumasConceptosWritertoCfdiUtils\SumasConceptos\SumasConceptosWriter.
- The certificate PAC used for testing
30001000000400002495is included. - The class
CfdiUtilsTests\Validate\ValidateTestCasewas renamed toCfdiUtilsTests\Validate\Validate33TestCaseand extracted toCfdiUtilsTests\Validate\ValidateBaseTestCasebecause it shares a lot of logic withCfdiUtilsTests\Validate\Validate40TestCase. - The class
CfdiUtils\SumasConceptos\SumasConceptosWritercan handle both CFDI 3.3 & 3.4.
This version introduces this soft breaking compatibility changes, your implementation should not be affected:
[BC] REMOVED: These ancestors of CfdiUtils\Validate\Cfdi33\Xml\XmlFollowSchema have been removed: ["CfdiUtils\\Validate\\Cfdi33\\Abstracts\\AbstractVersion33"]
Other changes:
- Update license year, happy new year.
- Update PHPUnit config file.
Version 2.18.3 2022-01-15
Fix Carta Porte 1.0 add missing element Notificado. Thanks @celli33.
Version 2.18.2 2021-12-17
Fix Carta Porte 2.0 XML Namespace.
Version 2.18.1 2021-12-17
Remove development/ from distribution package.
Version 2.18.0 2021-12-17
Add CfdiUtils\Elements\CartaPorte20 Elements to work with "Carta Porte 2.0".
Add Elements Maker, a development tool to create element classes based on a specification file.
Fix dev:coverage composer script.
Version 2.17.0 2021-12-10
The helper object SumasConceptosWriter also writes the sum of impuestos locales when they are present.
Thanks, @celli33 and @luffinando for your help.
Version 2.16.1 2021-12-08
Fix bug when create expression to query for the SAT status and the RFC (emisor or receptor) contains
the characters & or Ñ. The service requires that the expression is XML "encoded".
Thanks, @ramboram and @TheSpectroMX for your help.
Refactor test script tests/estadosat.php.
Fix typos on "Complemento de Nómina versión 1.2, revisión B" documentation.
Version 2.16.0 2021-11-09
Add CfdiUtils\Elements\CartaPorte10 Elements to work with "Carta Porte 1.0".
Include the following unreleased changes
2021-07-05
- Fix documentation badge point to latest instead of stable.
- Fix build on Read The Docs by adding a config file and Python requirements file.
2021-05-18
- The Certificado de Sello Digital (CSD)
CSD01_AAA010101AAAis expired, it has been changed toEKU9003173C9. - Upgrade
php-cs-fixerto version3.0.
Version 2.15.1 2021-04-04
- Fix try to close public key when it didn't exist. Good catch PHPStan!
Migrate from Travis-CI and AppVeyor to GitHub Actions
I'm more than grateful to both platforms for supporting this open source project for the previous years. I recommend both platforms as an alternative to GitHub Actions.
Version 2.15.0 2021-03-17
Improvements:
- Include validation web service version 1.3 new response
ValidacionEFOSasStatusResponse::getValidationEfos() stringandStatusResponse::isEfosListed() bool. - Update
ConsultaCFDIServiceSAT.svc.xml. It is unused, but exists for compatibility.
General:
- Upgrade to PHPUnit 9.5 and upgrade test suite.
- Test classes are declared as final.
- Remove support for PHP 7.0, PHP 7.1 and PHP 7.2.
- Grant compatibility with PHP 8.0 / OpenSSL:
- openssl functions does not return resources but objects.
- On deprecated functions run only if PHP version is lower than 8.0 and put annotations for
phpcs.
Bugfixes:
- Validation
SELLO04fails when there are special characters likeéandLC_CTYPEis not setup. - Fix
COMPIMPUESTOSC01description typo.
There are some soft backwards incompatibility changes:
- Method
__construct()of classCfdiUtils\Validate\Cfdi33\Standard\FechaComprobantebecame final - Method
__construct()of classCfdiUtils\Validate\Cfdi33\RecepcionPagos\Pagobecame final - The return type of
CfdiUtils\Validate\Cfdi33\RecepcionPagos\Pago#getValidators()changed from no type to array - The parameter $decimals of
CfdiUtils\Utils\Format::number()changed from no type to a non-contravariant int - The parameter $content of
CfdiUtils\Cleaner\Cleaner::staticClean()changed from no type to a non-contravariant string.
Development environment:
- AppVeyor: Only run PHPUnit
- Travis-CI: On PHP != 7.4 only run PHPUnit
- Travis-CI: On PHP == 7.4 run all the build commands
- PHPStan: Upgrade to version 0.12, downgrade level to 5.
Version 2.14.2 2021-03-16
FormaPago on N - Nómina
- Validation
TIPOCOMP03does not apply on documents typeN - Nómina.
Version 2.14.1 2021-03-14
MetodoPago on N - Nómina
- Remove redundant validations
METPAG01andMETPAG02. - Validation
TIPOCOMP04does not apply on documents typeN - Nómina.
Download certificates (unreleased 2020-10-08)
- Looks like web service at
https://rdc.sat.gob.mx/is having issues (again). This is breaking testing. To mitigate the problem, a new testing classCertificateDownloaderHelperhas been created to retry the download if it fails, for a maximum of 5 attempts. This change does not create a new release version.
Travis-CI build (unreleased 2020-12-03)
- Add
XDEBUG_MODE=coverageon Travis-CI configuration file since it upgrade toXDebug v3.0.0and it contains a bug that makesPHPUnitbreak with the message: Use of undefined constant XDEBUG_CC_UNUSED - assumed 'XDEBUG_CC_UNUSED'. This will be resolved on https://github.com/xdebug/xdebug/pull/699 but not released (yet).
Version 2.14.0 2020-10-01
- Add
Retencionesreader to work with CFDI de retenciones e información de pagos. - Refactor
CfdiandRetencionesto use recently createdXmlReaderTrait.
Version 2.13.1 2020-10-01
- Fix validation
FORMAPAGO01, it only applies whenComplemento de Pagoexists. - Add
Retencionesreader to work with CFDI de retenciones e información de pagos.
Version 2.13.0 2020-08-28
- Add helper elements for Complemento de Nómina 1.2 revisión B.
- Root element is
CfdiUtils\Elements\Nomina12\Nomina. - Add test with 100% coverage on the namespace.
- Add documentation.
- Important It does not contain any validators but standard
XSD.
- Root element is
Version 2.12.11 2020-08-16
- Fix TimbreFiscalDigital XSLT URL locations, updated from SAT documentation.
For more information check
phpcfdi/sat-ns-registryproject.
Version 2.12.10 2020-07-18
-
Documentation "Descarga de recursos XSD y XSLT"
- 2020-07-14: Documentation: "Descarga de recursos XSD y XSLT"
- 2020-07-18: Documentation: Add last document to
mkdocs:nav, format rewording and links.
-
Add
tests/resource-sat-xml-download, include it on travis build.
SAT has been failing providing XSD and XSLT files. This tool obtains (via tests/resource-sat-xml-download) a fresh copy
of those files from phpcfdi/resources-sat-xml project for development.
-
Add script to install
phpcfdi/resources-sat-xmlon AppVeyor build. -
Fix default locations for TFD 1.0.
In the past, SAT allowed at least 2 different URLS for TFD 1.0 on XSD and XSLT files. In this version this is
normalized with phpcfdi/sat-ns-registry project.
- Add a new cleaner method
Cleaner::fixKnownSchemaLocationsXsdUrlsto override the XSD file URLS for CFDI and TFD.
This replaces any known and found url ignoring case and put the correct one,
it also replaces http://www.sat.gob.mx/sitio_internet/TimbreFiscalDigital/TimbreFiscalDigital.xsd (unused)
with http://www.sat.gob.mx/sitio_internet/cfd/TimbreFiscalDigital/TimbreFiscalDigital.xsd (official).
- Improve explanation on
TFDSELLO01when unable to get certificate.
The assertion TFDSELLO01 El Sello SAT del Timbre Fiscal Digital corresponde al certificado SAT, now includes the
exception message when unable to obtain a certificate.
- Remove insecure downloader from testing.
This was introduced previously because the webserver was using invalid SSL certificates. This problem does not exist anymore (since 2019-10-24).
Version 2.12.9 2020-04-25
- Review and fix
CreateComprobantePagosCaseTest. - Add doc-blocks on
StatusResponseand fix scripttests/estadosat.php. - Remove
overtrue/phplintfrom development dependencies.
Version 2.12.8 2020-01-07
- Change License year to 2020.
- Change running dependence of
symfony/processto allow version^0.5 - Change development dependence
phpstan/phpstan-shimtophpstan/phpstan(versions^0.9to^0.11)
Version 2.12.7 2019-12-04
- Add 2 new default cleans, before loading the CFDI as XML DOM Document:
- Change invalid
xmlns:schemaLocationtoxsi:schemaLocation. SAT uses to create "valid" CFDI with this error. - Remove
xmlns="http://www.sat.gob.mx/cfd/3"when alsoxmlns:cfdi="http://www.sat.gob.mx/cfd/3"is found.
- Change invalid
- Improve
SerialNumberto usemap + impodeinstead of concatenation. - Improve
SerialNumbertosubstrinstead ofstrposto check if a string start with text. - (DOC) Add cleaner notes and example about clean before load.
- (DOC) Simplify example on
RequestParametersusage. - (DEV) Add support for PHP 7.4 on Travis-CI
- (DEV) Add support for PHP 7.4 on AppVeyor
- Downgrade
chocolateyto 0.10.13 - Add
--no-progresstochococommands - Setup extensions declared without prefix
php_on PHP versions lower than 7.2 - Add
PHP_CS_FIXERenvironment variables
- Downgrade
Version 2.12.6 2019-10-23
- Fix
REGFIS01validation when receiving an RFC with non-ASCII chars (likeÑ). It does not validate that the RFC is correct, that validation is onEMISORRFC01. - Add installation to documentation.
- Improve
php-cs-fixerrules. - Fix travis build on PHP version
7.4snapshot.
Version 2.12.5 2019-10-15
- Fix bug when creating a
Certificadoobject and PEM content's length is less than 2000 bytes.- Now it does not care about the length.
- If the content is a valid base64 string but is a path then will be used as a path.
- When checking that the file exists, catches if the path has control characters (like in DER content).
- Previous validation now makes
file_existsto not throw anError.
Version 2.12.4 2019-10-10
- The validation
CONCEPDESC01was not correctly set, it was checking concept discount against document subtotal, it was fixed to concept discount against concept import. It covers SAT ruleCFDI33151, notCFDI33109. - New validation
DESCUENTO01that verify document discount against document subtotal, coversCFDI33109. - Development: include
build/empty folder (with.gitignoreto exclude all) - Continuous Integration:
- Travis remove
sudo: falseand build ondist: xenial. - Scrutinizer add more time to wait for coverage test.
- Remove CodeClimate integration.
- Travis remove
Version 2.12.3 2019-09-26
CfdiUtils\Certificado\Certificadocan be created using PEM contents and not only a certificate path.CfdiUtils\Creator33can use a certificate without associated filename.CfdiUtils\RetencionesCreator10can use a certificate without associated filename.CfdiUtils\Certificado\NodeCertificadocan obtain the certificate without creating a temporary file.
Version 2.12.2 2019-09-24
-
When cannot load a Xml string include
LibXMLErrorinformation into exception, like:text Cannot create a DOM Document from xml string XML Fatal [L: 1, C: 7]: Input is not proper UTF-8 -
Include composer
supportsectionssourceandchat - Development: Exclude correct file
.appveyor.yml(was.appveyor.xml)
Version 2.12.1 2019-09-11
- Trigger E_USER_DEPRECATED on
CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation() - Trigger E_USER_DEPRECATED on
CfdiUtils\Certificado\SerialNumber#baseConvert() - Improvements on docs/index
- Remove several development files from final package
- Development:
- Fix
.editorconfig - Integrate
codeclimate, evaluate for a while to consider a replacement forscrutinizer - Add PHP 7.4snapshot
- Remove Symfony Insight config file
- On
composer dev:buildit also callscomposer dev:check-style
- Fix
Version 2.12.0 2019-09-03
- Add
CfdiCreator33::moveSatDefinitionsToComprobante()method to move xml definitions (xmlns:*andxsi:schemaLocation) to root node where namespace starts withhttp://www.sat.gob.mx. - Add
CfdiUtils\Nodes\NodeNsDefinitionsMoverthat allows to move all (or filtered) namespace definitions (xmlns:*andxsi:schemaLocation) to root node. - Improve
XmlNodeImporterto read xml as<node xmlns="namespace"/>. - Create
SchemaLocations, this utility helps to manage the content ofxsi:schemaLocationattribute. - Refactor
Cleaner, internal improvements and use ofSchemaLocations. - Mark
CfdiUtils\Cleaner\Cleaner:removeIncompleteSchemaLocation()as internal, it should always be private - Fix composer.json links
Version 2.11.0 2019-08-06
- Add
Cleaner::collapseComprobanteComplemento()to deal with more than onecfdi:Complemento. - Append call to
Cleaner::collapseComprobanteComplemento()onCleaner::clean(). - Create test that demostrate issues when
TimbreFiscalDigitalis on a secondcfdi:Complementoand that collapsing removes the issues and do not change the "cadena de origen". - Document SAT issue with multiple
cfdi:Complemento(problems and clean). - Travis: since
mkdocsversion is newer, there is no need to changenavtopagesto compile docs. - PHPStan: create
phpstan.neon.distwithinferPrivatePropertyTypeFromConstructor.
Version 2.10.4 2019-06-27
- Add
Xml::createElementandXml::createElementNSto deal with non escaped ampersand&onDOMDocument::createElementandDOMDocument::createElementNS. - Improve
Rfc::obtainDatewith invalid length dates and tests
Version 2.10.3 2019-05-29
- Add static methods to
CfdiUtils\Utils\Xml, these methods are created to help to fix issues found byphpstan:Xml::documentElement(DOMDocument $document): DOMElement: Safe helper to get$document->documentElementXml::ownerDocument(DOMNode $node): DOMDocument: Safe helper to get$node->ownerDocument
- Fix
phpstan0.11.6 issues, this must solve all travis build
Version 2.10.2 2019-04-08
- Fix bug on
QuickReadergetting the content of falsy values (like"0") return an empty string. Thanks@jaimeres. (Closes #48)
Version 2.10.1 2019-04-02
- When any
Throwableis thrown onXmlFollowSchemavalidator fail with error, previous behavior was to just catchSchemaValidatorException. - Add specific tests for
XmlFollowSchema. - Move community chat from gitter to discord https://discord.gg/aFGYXvX
Version 2.10.0 2019-03-26
- Include in
CfdiUtils\ConsultaCfdiSat\StatusResponsethe values ofEsCancelableandEstatusCancelacion. - Change SOAP call to avoid WSDL requirement.
- Deprecate uses of WSDL in
CfdiUtils\ConsultaCfdiSat\Config. - Update Estado SAT documentation.
- SymfonyInsight, add config file
.symfony.insight.yaml
Version 2.9.0 2019-03-15
- Add
CfdiUtils\OpenSSL, a helper class to work withopensslcommands and CER, KEY and PEM files. Fully tested and documented. - Improve other components by depending on
CfdiUtils\OpenSSL:CfdiUtils\Certificado\Certificado:- Use
OpenSSLPropertyTrait. - Allow to construct using a
OpenSSLobject, default to create a new one. - Remove protected method
changeCerToPem.
- Use
CfdiUtils\PemPrivateKey\PemPrivateKey:- Use
OpenSSLPropertyTrait. - Allow to construct using a
OpenSSLobject, default to create a new one. - Deprecate static method
isPEM, useOpenSSLinstead. - Fix test since OpenSSL is stricter on getting contents.
- Since this version, other private keys are allowed, as the created by PHP
ENCODED PRIVATE KEY.
- Use
- Improvements on
SaxonbCliBuilder:- Improve compatibility on MS Windows by using
ShellExec. - Deprecate method
createCommand. - Use new features from internal class
TemporaryFile.
- Improve compatibility on MS Windows by using
- Test:
- Increase coverage of
XmlResolverPropertyTrait. - Cover
SumasConceptosWriter::getComprobante(). - Cover
CfdiUtils\Certificado\SerialNumber::loadHexadecimalwhen throw exception. - Cover
CfdiUtils\Nodes\Attributes::import(and constructor) when throw exception.
- Increase coverage of
Genkgo/Xslupgraded to 0.6 (compatible with PHP 7.0), also fix suggestion oncomposer.jsonfile.- Internal:
TemporaryFilenow is able to cast itself to string returning the path to file, retrieve contents, store contents and remove file after run some function even if exception was thrown. - Internal: Add
ShellExecclass that works around withsymfony/processcomponent. Also added:ShellExecResponse: contains the response of ShellExec::run().ShellExecTemplate: basic command array creation from a string template.
- Internal: Move internal to
CfdiUtils\Internal. Check@internalannotation on all elements. Add README.md - CI:
AppVeyorcomplete refactor, now uses correctly caches and upgrade php if required. - CI: Only run
phpstanon PHP 7.3. - Dev:
composer dev:buildnow runsphpunit --testdox --verbose --stop-on-failure.
Version 2.8.1 2019-02-05
- Extract base convert logic from
CfdiUtils\Certificado\SerialNumber::baseConvertto new internal classes:CfdiUtils\Utils\Internal\BaseConverterSequenceValue object to store the character maps.CfdiUtils\Utils\Internal\BaseConverterObject that perform the conversion.
- Fix possible bug converting from an inferior to a superior base thanks to new test on
BaseConverter. - Classes inside
CfdiUtils\Utils\Internal\namespace should not be used outside the library. Changing this will not be considered a backward compatibility break. - Deprecate
CfdiUtils\Certificado\SerialNumber::baseConvert. - Create
CfdiUtils\Utils\Internal\TemporaryFileto avoid using directly\tempnamand throw\RuntimeException - Replace usages of
\tempnamwithTemporaryFile::create()on:CfdiUtils\CadenaOrigen\SaxonbCliBuilderCfdiUtils\Certificado\NodeCertificadoCfdiUtils\Validate\Cfdi33\Standard\TimbreFiscalDigitalSelloCfdiUtilsTests\Certificado\NodeCertificadoTest
- Fix possible bug on
CfdiUtils\Cleaner\Cleanerwhen making an XPath query. - Fix docblock on
CfdiUtils\QuickReader\QuickReaderon magic method__get. - Fix issues on functions expecting a variable of certain type but receiving false instead. Thanks
phpstan! - Call
NodeInderface::offsetExists($name)instead ofisset(NodeInderface[$name]). The reasons behind this change are:issetis not a function but a keyword, makingphpstanor other tools to fail on this.issetshould be understand as variable is defined and is notNULL, which in the case ofNodeInderface[$name]is neverNULL. The previous change does not have to be replicated in the users of this library. It is internal. In future version (when BCB are allowed) will introduce a better method for this operationNodeInderface::exists(string $name): booland will fix documentation to better use this method instead ofisset.
- Fix documentation on
docs/leer/leer-cfdi.mdabout methodNodeInterface::getNode(). Thanks@ReynerHL.
Version 2.8.0 2019-01-29
- Initial attempt to create a RET 1.0 (CFDI de retenciones e información de pagos):
- Add namespace
\CfdiUtils\Retenciones. - Add class
\CfdiUtils\Retenciones\RetencionesCreator10. - Add test for green path on creating a CFDI without TFD.
- Add test to ensure that
validatemethod is checking document against schema. - Add namespace
\Elements\Retenciones10to add helper elements forretenciones:Retenciones. - Add namespace
\Elements\Dividendos10to add helper elements fordividendos:Dividendos. - Add namespace
\Elements\PagosAExtranjeros10to add helper elements forpagosaextranjeros:Pagosaextranjeros.
- Add namespace
CfdiUtils\CfdiCreator33constructor docblock was setting type of attributes asstring[]when it should bearray. Values can be scalar and objects with__toString()implemented.- Inside attributes, when casting an attribute value to string fails then show the attribute name in exception.
Version 2.7.6 2019-01-17
- Rename validation code
XDS01toXSD01as reported by@blacktrue SumasConceptosmust ignoreComprobante/Conceptos/Concepto/Impuestos/Traslados/TrasladowhenTipoFactor == Exento.- Add tests on how
SumasConceptosshould work withTipoFactor == Exentoand how attributes are written. - Travis: since
mkdocsversion is old, just changenavtopagesto compile docs. - Docs: Improve texts and examples on Cadena de Origen.
Version 2.7.5 2019-01-04
- Make
XsltBuilderPropertyTraitfollow other*PropertyTrait - Improve documentation on Cadena de Origen
- Fix
mkdocs.ymlconfig,pagesis deprecated, now usenav
Version 2.7.4 2018-12-12
- Add
CfdiUtils\Certificado\Certificado::getSerialObjectto return a copy of the instance ofCfdiUtils\Certificado\SerialNumberin case is required. - Add
CfdiUtils\Certificado\SerialNumber::loadAsciihelper function - Improve tests on
SerialNumberTestto includeloadAscii - Improve tests on
CertificadoTestto includegetSerialObject
Version 2.7.3 2018-12-05
- Fix previous release since it did not publish the changes made on 2.7.2.
Version 2.7.2 2018-12-05
- Add method
CfdiUtils\Certificado\Certificado::getCertificateName(): stringto obtain the certificate name as returned byopenssl_x509_parse.
Version 2.7.1 2018-12-04
- Fix wrong use of
escapeshellcmdreplacing withescapeshellarg - Add argument
-c|--cleanto scripttests/validate.phpto perform clean before validate - Fix
CfdiCreator33::newUsingNodesince not all attributes where correctly imported (xsi:schemaLocation) - Fix calling
CfdiCreator33::putCertificadoon imported cfdi (Emisor child is aNodeInterfacebut notEmisor) - Refactor
CfdiUtils\ConsultaCfdiSat\WebServiceto be able to use a local copy of WSDL file since SAT does not allow to download it anymore.- Add
ConsultaCFDIServiceSAT.svc.xmlto namespace folder - Add
Config::wsdlLocationstatic method to getConsultaCFDIServiceSAT.svc.xmlfile path - Deprecate
Config::getWsdlUrlin favor ofConfig::getServiceUrl - Add
Config::getServiceUrl - Add
Config::wsdlLocationproperty
- Add
- Add
--local-wsdlparameter totests/estadosat.phpscript - Add a new step on
CfdiUtils\Cleaner\Cleanerthat removes fromxsi:schemaLocationsthe namespaces that are not followed by a string that ends on.xsd
Version 2.7.0 2018-10-19
- Reintroduce
MontoGreaterOrEqualThanSumOfDocumentsasPAGO30.- There is a legal contradiction in
PagosbetweenGuía de llenadoandMatriz de errores - For more information check documentation https://cfdiutils.readthedocs.io/es/latest/problemas/contradicciones-pagos/
- There is a legal contradiction in
- Change
CfdiUtils\Validate\Cfdi33\RecepcionPagos\Pagos\ValidatePagoExceptionto use status property. - Change
CfdiUtils\Validate\Cfdi33\RecepcionPagos\Pagos\ValidateDoctoExceptionto extendsValidatePagoException. - Honor status from
ValidatePagoExceptionorValidateDoctoException - Tests use XmlResolver from
CfdiUtilsTests\TestCaseinstead of creating a new one - Fix docblock
CfdiUtils\Nodes\Nodes::searchNodes - Improve doc-blocks on
CfdiUtils\Certificado\Certificado - Documentation:
- Create
docs/problemas/contradicciones-pagos.md - Create
docs/problemas/descarga-certificados.mdto document errorTFDSELLO01 - Create examples on
docs/componentes/certificado.mdon object creation
- Create
- Change tests to not ssl verify peer due SAT web server configuration errors (expired certificate)
- Add
CfdiUtilsTests\TestCase::newInsecurePhpDownloader(): DownloaderInterface - Use insecure downloader in
CfdiUtilsTests\CfdiValidator33Test - Use insecure downloader in
CfdiUtilsTests\Validate\Cfdi33\Standard\TimbreFiscalDigitalSelloTest - Use insecure downloader in
CfdiUtilsTests\Certificado\CerRetrieverTest - Also add note to
docs/TODO.mdto remove this insecure downloader when SAT server is fine
- Add
- Change composer scripts and prefix
dev:, commands are now:dev:build: run dev:fix-style dev:tests and dev:docs, run before pull requestdev:check-style: search for code style errors using php-cs-fixer and phpcsdev:fix-style: fix code style errors using php-cs-fixer and phpcbfdev:docs: search for code style errors usingmarkdownlintand build docs usingmkdocsdev:test: runphplint,phpunitandphpstandev:coverage: runphpunitwithxdebugand storage coverage inbuild/coverage/html
Version 2.6.6 2018-10-04
- After previous update on validation
PAGO09and more testing found that it requires to round lower and upper limits. - Create more 1 case with specific data and 1 test with 20 cases with random data.
Version 2.6.5 2018-10-04
- Fix validation
PAGO09:- Before 2018-09-01
pagos10:Pago@Montomust be less or equal than sum ofpago10:DoctoRelacionado@ImpPagadoin the same currency aspagos10:Pago. - Since 2018-09-01 according to Guía de llenado del comprobante al que se le incorpore el complemento para
recepción de pagos, page 22 it is required that
pagos10:Pago@Montomust be in an interval. - Fix samples from
tests/assets/pagos/since new validation make it fail. - Rename validation class
MontoGreaterOrEqualThanSumOfDocumentstoMontoBetweenIntervalSumOfDocuments
- Before 2018-09-01
- Refactor
CfdiUtils\Certificado\Certificadoextracting obtain public key routine to an internal method. - Create tests for trait
CalculateDocumentAmountTrait.
Version 2.6.4 2018-09-04
- Fix validation
TIPOCAMBIO02:- Previous validation only allows value
"1"if currencyMXN. Now it allows any value equals to1considering 6 decimal numbers, so the following values are valid:"1","1.00","1.000000" - Change description from
... debe ser "1"...to... debe tener el valor "1"...
- Previous validation only allows value
- Fix Scrutinizer issue in
Validate/Cfdi33/Standard/ComprobanteImpuestos.php: Using logical operators such as and instead of && is generally not recommended CfdiUtils\ConsultaCfdiSat\WebServiceis using SAT Web Service but since 2018-08 it is randomly failing. The test that are consuming https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?singleWsdl was moved to a different test case classWebServiceConsumingTestand are marked as skipped when\SoapFaultis thrown instead of fail- Fix
xmlns:xsidefinition case toXMLSchema - Allow to install phpunit 7 if php >= 7.1
- Fix
phpunit.xml.distconfiguration file removing redundant options and setting missing options - Solve PHPStan 0.10.x issues, not yet upgraded since it contains several bugfixes
Version 2.6.3 2018-08-21
- Fix validations
COMPIMPUESTOSC02andCOMPIMPUESTOSC03Previously both or any should exist (xnor): nodesTraslado|Retencionand attributesTotalImpuestosTrasladados|TotalImpuestosRetenidosNow it allows to haveImpuestostotals even when related nodes does not exist This is because is not mandatory by Anexo 20 What is mandatory is that if nodes exists then totals must exist - Add helper method to create a
RequestParametersfrom aCfdi - Fix: add missing dependence
ext-iconvintocomposer.json - Testing: add helper development script
tests/estadosat.php - Testing: Change compareNames & castNombre visibility for direct testing
Version 2.6.2 2018-07-17
- Dependence on https://github.com/eclipxe13/XmlSchemaValidator has been set to
^2.0.1to fix validation using XSD local repository on MS Windows. - Improve doc-blocks in property traits
- Restore previous error handler on
ComprobanteGetCfdiRelacionadosTest - Make sure that input file on
PemPrivateKeyis not a directory and is readable - On MS Windows send to
NULinstead of/dev/null - Convert from
UTF-8toASCII//TRANSLITcan add single quotes, remove it. - Add AppVeyor continuous integration
- Add documentation about developing this library on Windows
- Allow to set
saxonbpath using environment variablesaxonb-path
Version 2.6.1 2018-07-16
- Fix order of
Impuestoschildren (thanks@aldolinares):- When is inside
Comprobantethe order isRetencionesthenTraslados - When is inside
Conceptothe order isTrasladosthenRetenciones
- When is inside
- Add
testMultiRelacionadoinComprobanteTest - Fix Markdown syntax errors in a lot of documents
- Use self instead of static in doc-blocks, static is not standard
- Add badges to
docs/index.md
Version 2.6.0 2018-07-06 - bugfixes, QuickReader & welcome ReadTheDocs & MkDocs
- Create
QuickReader, utility for easy navigate and extract information from a CFDI - Fix
Rfcto don't throw an exception if checksum fails, SAT is not following its own standard - Add
Rfc::checkSum()andRfc::checkSumMatch()to know if the Rfc is following the checksum - Fix tests that expect Rfc checksum failure
- Fix tests comments on
testDescuentoNotSetIfAllConceptosDoesNotHaveDescuento - Fix
CfdiUtils\Elements\Cfdi33\Comprobante::getCfdiRelacionadosto don't receive a parameter.- For backwards compatibility when it receives a parameter do the same thing but trigger a
E_USER_NOTICE - Create a special test case
ComprobanteGetCfdiRelacionadosTestthat catch theE_USER_NOTICEerror
- For backwards compatibility when it receives a parameter do the same thing but trigger a
- Add
CfdiUtils\Elements\Cfdi33\Comprobante::addCfdiRelacionados(array $attributes) - Add
CfdiUtils\Elements\Cfdi33\Comprobante::multiCfdiRelacionado(array $attributes) - Add tests to assert that
Comprobante/Impuestos/(Traslados/Traslado|Retenciones/Retencion)@Impuestois rounded - Minor fix at doc-blocks for packed arguments
- Change all documentation to move from GitHub Wiki to ReadTheDocs https://cfdiutils.readthedocs.io/
- More documentation pages & a lot of fixes
- Add
.markdownlint.jsonto run withmarkdownlint-cli(node), add to travis build process - Add
mkdocs.ymlto run withmkdocs(python), add to travis build process - Fix markdown files according to
markdownlint - Add
composer docsand append to generalcomposer build
Version 2.5.1 2018-06-26
- Fix edge case for validations
SELLO03andSELLO04onSelloDigitalCertificado. In some cases, the authority does not require a certificate from emisor and uses one certificate for its own. Therefore, theRfcandNombreof theEmisordoes not match with the certificate. This produces a false error. To avoid this issue, the validation ofRfcandNombrematching with the certificate data must not perform when:- The
cfdi:Comprobante@NoCertificadois the same as thetfd:TimbreFiscalDigital@NoCertificadoSAT - The "complemento"
registrofiscal:CFDIRegistroFiscalexists
- The
Version 2.5.0 2018-05-24
- Add validations for
http://www.sat.gob.mx/Pagosat namespace\CfdiUtils\Validate\Cfdi33\RecepcionPagosThis is a big change that includes more than 50 validators that work in cascade. It implements almost all the validations from the SAT "Matriz de errores". - Append it to
\CfdiUtils\Validate\MultiValidatorFactory - Remove non-existent validators discovery
Cfdi33/Timbre - Move logic of version discovery to a new class, change
CfdiVersionandTfdVersionto implement this logic - Deprecate
staticmethods from\CfdiUtils\CfdiVersion, instead create an instance of the class - Deprecate
staticmethods from\CfdiUtils\TimbreFiscalDigital\TfdVersion, instead create an instance of the class - Fix deprecation notices existent doc-blocks
- Update deprecation notice to README
- Replace TODO with a more explained version
Version 2.4.6 2018-05-24
- Fix validation of
TIPOCOMP06, it was not checking correctly. - Fix bug in validators that does not respect when the resolver does not have local path:
CfdiUtils\Validate\Cfdi33\Standard\TimbreFiscalDigitalSelloCfdiUtils\Validate\Cfdi33\Xml\XmlFollowSchema
- Fix bug when removing a
schemaLocationattribute inCfdiUtils\Cleaner\Cleaner - Refactor
CfdiUtils\ConsultaCfdiSat\WebService::requestand move the SOAP call to a protected method, this allows better testing of the class by mocking the call - In
CfdiUtils\PemPrivateKey\PemPrivateKeydeprecateisOpenedand addisOpen - In
CfdiUtils\Cfdi::getNodeuseXmlNodeUtilsinstead ofXmlNodeImporter - In
CfdiUtils\Cfdi::newFromStringcreatenew selfinstead ofnew static. If usingnew staticthe constructor might be different, and it would fail. - In
CfdiUtils\CfdiVersion::fromXmlStringit no longer create a Cfdi object, it will just create aDOMObjectand delegate tofromDOMDocumentas inTfdVersion. - Remove
CfdiUtils\Elements\Pagos10\Pago::multiImpuestos, it should never exist and must not have any use case. - Improve testing on:
CfdiUtils\Elements\Pagos10\PagosCfdiUtils\Validate\Cfdi33\Standard\ConceptoImpuestos
- Improve doc-blocks and fix typos in several files
- Add new parameter to development script
tests/validate.php:--no-cachethat tell resolver to not use local cache. - Improve travis disabling xdebug always and only use it in phpunit code coverage
Version 2.4.5 2018-05-12
- Fix: change xml namespace prefix
pagos10topago10 - Refactor
CfdiUtils\Certificado\SerialNumber::baseConvert - Add
CfdiUtils\Certificado\SerialNumber::asDecimal() - Fix
CfdiUtils\Cleaner\Cleanersince internalDOMDocumentcan be null - Allow attributes
CfdiUtils\Elements\Cfdi33\Comprobante::getCfdiRelacionados - Do not use
CfdiUtils\CadenaOrigen\DefaultLocationsat any place of the project - Add util
\CfdiUtils\Utils\CurrencyDecimals, help to work with decimals by currency - Improve
CfdiUtils\Validate\Cfdi33\Standard\ComprobanteDecimalesMonedawith previous class - Add util
\CfdiUtils\Utils\Rfc, help to work with strict RFC validations - Add
\CfdiUtils\Validate\Cfdi33\Standard\ReceptorRfcto validate the RFC of the CFDI receiver - Add
\CfdiUtils\Validate\Cfdi33\Standard\EmisorRfcto validate the RFC of the CFDI emitter- Fix
CfdiUtilsTests\CfdiValidator33Test::testValidateWithCorrectDatasince used RFC is not valid - Fix
CfdiUtilsTests\CreateComprobanteCaseTest::testCreateCfdiUsingComprobanteElementsince used RFC is not valid
- Fix
- Add doc-blocks to
CfdiUtils\Cfdi - Building:
- Add
.phplint.ymlto export-ignore (standard line) - Travis-CI: Declare
FULL_BUILD_PHP_VERSIONfor easy understanding
- Add
- Add more dependencies:
ext-dom,ext-xsl,ext-simplexml,ext-mbstring
Version 2.4.4 2018-05-11
- FIX: Unable to load a PEM file using filename on Windows (Closes #33)
- Do not use bcmath function to convert from decimal to hexadecimal the serial number of a certificate
Version 2.4.3 2018-04-26
- FIX: The attribute
cfdi:Comprobante@Descuentomust not be deleted if any attributecfdi:Comprobante/cfdi:Conceptos/cfdi:Concepto@Descuentoexists. (Closes: #50) - FIX: When validating a CFDI, the validator
CfdiUtils\Validate\Cfdi33\Standard\SelloDigitalCertificadowas too hard. In common practice, must allow-,-and compare without special chars likeü. (Closes #51) - Add a development script
tests/validate.phpto validate existing files. WARNING: This can change at any time! Do not depend on this file or its results!
Version 2.4.2 2018-04-23
- Fix
\CfdiUtils\Nodes\XmlNodeExporter::export, it was not appending root element to xml document. - Allow
\CfdiUtils\Nodes\XmlNodeUtils::nodeToXmlStringto export including xml header<?xml ... ?>. Default behavior is to not include xml header, it remains unchanged. - Explicitly
\CfdiUtils\CfdiCreator33::asXml()returns the string with xml header. - By default,
\DOMDocumentobjects are created with version 1.0 and encoding UTF-8. - Add tests to validate previous changes.
Version 2.4.1 2018-04-11
- Fix
\CfdiUtils\Certificado\Certificadowhen reading serial number.- Use
serialNumberHexif available, if not then useserialNumberand convert to hex.
- Use
- Move serial number string conversion to class
\CfdiUtils\Certificado\SerialNumber. This class is not for public use but for use insideCertificate.
Version 2.4.0 2018-02-08
- Add the feature to order the children nodes for a
CfdiUtils\Nodes\Nodesobject. This feature is used in the namespaceCfdiUtils\Elementsto set the correct order of the children nodes without worry about the creation order. - Add
CfdiUtils\Elements\Addendahelper class. - Add
CfdiUtils\Elements\Pagos10namespace for "complemento de pagos 1.0". - Add
CfdiUtils\Cleaner\Cleanerutility class that allows to removecfdi:Addenda, non SAT nodes, non SAT namespaces and unused namespaces. - Build: The project no longer depends on
jakub-onderka/php-parallel-lint, now usesovertrue/phplintthat does the same task but stores a cache.
Version 2.3.2 2018-01-29
- Fix how total is formatted in the expression of
\CfdiUtils\ConsultaCfdiSat\RequestParameters- Version 3.2 was removing zero trailing decimals instead of using 6 fixed chars
- Version 3.3 was not using 1 leading zero (for integers) and 1 trailing zero (for decimals)
- On method
\CfdiUtils\Certificado\NodeCertificado::obtain()change logic and throw exception if temporary file cannot be created
Version 2.3.1 2018-01-25
- Add elements helpers
CfdiUtils\Elements\Tfd11\TimbreFiscalDigitalto work with "TimbreFiscalDigital"
Version 2.3.0 2018-01-25
- Add a client
\CfdiUtils\ConsultaCfdiSat\WebServicefor the SAT WebServicehttps://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?singleWsdl - Fix bug, must use
children()method instead ofchildrenproperty. Did not appear before because the variable using the property was always aNodebut other implementation ofNodeInterfacewould cause this to break. - Add a lot of fixes in doc-blocks to move
@param $varto@param type $var. - Add extensions requirements to composer.json: libxml, openssl & soap.
- Upgrade
phpstan/phpstan-shimto version 0.9.1, the not-simple-to-see bug fixed in this version was found byphpstan- https://github.com/phpstan/phpstan
Version 2.2.0 2018-01-24
- Refactor namespace
\CfdiUtils\CadenaOrigen(backwards compatible):- Instead of one only xslt builder now it includes:
DOMBuilder: Uses the regular PHP based methodGenkgoXslBuilder: Uses the librarygenkgo/xslxslt version 2 librarySaxonbCliBuilder: Uses the command linesaxonb-xsltcommand- Build process implementations must return
XsltBuildException(before they returnRuntimeException) - All builders must implement
XsltBuilderInterface - Add
XsltBuilderPropertyInterfaceandXsltBuilderPropertyTrait. It does not havehasXsltBuilderPropertymethod. DefaultLocationshas been deprecated in favor ofCfdiDefaultLocationsCadenaOrigenBuilderhas been deprecated in favor ofDOMBuilderCadenaOrigenLocationshas been deprecated, will not be replaced
- Implement
XsltBuilderPropertyInterfaceandXsltBuilderPropertyTraitin objects that use to createCadenaOrigenBuilderobjects. - For
CfdiCreator33andCfdiValidator33will create a default DOMBuilder object if none set. - Hydrator also receive and hydrates this by using
RequireXsltBuilderInterface. CertificadoPropertyInterfaceandCertificadoPropertyTraithas been created.- Improve the tests.
Version 2.1.0 2018-01-17
- Fix
SumasConceptosto work also with "ImpuestosLocales" - Add elements helpers
CfdiUtils\Elements\ImpLocal10\ImpuestosLocalesto work with "ImpuestosLocales" - Add
CfdiUtils\Certificado\CerRetrieverthat works withCfdiUtils\XmlResolver\XmlResolverto download a certificate from the SAT repository - Add a new validator
CfdiUtils\Validate\Cfdi33\Standard\TimbreFiscalDigitalSelloto validate that the SelloSAT is actually the signature of the Timbre Fiscal Digital. If not then the CFDI was modified - Add a new real and valid CFDI to test, this allows
TimbreFiscalDigitalSelloto check real data and pass - Update test with
cfdi33-valid.xmlto allow failTimbreFiscalDigitalSello - Travis: Remove xdebug for all but PHP 7.0
Version 2.0.1 2018-01-03
- Small bugfixes thanks to Scrutinizer
- Fix some doc-blocks
- Travis: Build also with PHP 7.2
Version 2.0.0 2018-01-01
- This library has been changed deeply.
- It can write CFDI version 3.3 using
CfdiUtils\Elements\Cfdi33and helper classCfdiUtils\CfdiCreator33 - It can read CFDI files version 3.2 and 3.3 using
CfdiUtils\Cfdi - It can validate a CFDI
- Rely on
CfdiUtils\Nodesto perform most operations. CadenaOrigenobject have been split into two different objects:CadenaOrigenLocationandCadenaOrigenBuilder.- New object helpers like
Elements,Certificado,PemPrivateKey&TimbreFiscalDigital - Include wiki for documentation
Version 1.0.3 2017-10-09
- Fix a bug to read the RFC when a certificate does not contain the pattern RFC / CURP but only RFC in the subject x500UniqueIdentifier field
Version 1.0.2 2017-09-28 - Thanks PHPStan!
- After using
phpstan/phpstanchange the execution plan onCadenaOrigenLocations. The function previous functionthrowLibXmlErrorOrMessage(string $message)always throw an exception, but it was not clear in the flow ofbuildmethod. Now it returns a \RuntimeException and that is thrown. So it is easy for an analysis tool to know that the flow has been stopped. - Also fix case of calls
XSLTProcessor::importStylesheetandXSLTProcessor::transformToXml - Check with
issetthatLibXMLError::$messageexists,phpstanwas failing for this.
Version 1.0.1 2017-09-27
- Remove Travis CI PHP nightly builds, it fails with require-dev dependencies.
Version 1.0.0 2017-09-27
- Initial release