Coder Social home page Coder Social logo

cfdi-cleaner's People

Contributors

blacktrue avatar eclipxe13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cfdi-cleaner's Issues

Broken build (2021-10-10)

The build process is broken, apparently the new version of php-cs-fixer check don't pass.
Please, fix the code base and make the build process pass again.

TypeError con la addenda de susuki

Hola, tengo un caso donde estamos leyendo XML con la addenda de susuki y el cleaner esta tirando TypeError.

<cfdi:Addenda>
    <Suzuki xsi:schemaLocation="http://repository.edicomnet.com/schemas/mx/cfd/addenda/Suzuki http://repository.edicomnet.com/schemas/mx/cfd/addenda/Suzuki.xsd" xmlns="http://repository.edicomnet.com/schemas/mx/cfd/addenda/Suzuki">
      <Header Email="[email protected]" FechaVencimiento="MIÉRCOLES, 19 DE JULIO DE 2023" Telefono="11111111" Web="www.suzuki.com.mx" fecDocumento="0000000000" numAlmacen="0" numCliente="1111111" numDocumento="121212_C142536" numPedidoCliente="0" tipoDocumento="05" xmlns="">
        <Detalles>
          <Detalle cantFacturada="1.000" codLinea="AUT-VTA-07" montoLinea="100000.26" numLinea="1" precioUnitario="100000.26" uMedidaFacturada="Pza" descripcion="description.">
            <Subdetalle Anio="0" marcaVehiculo="SUZUKI" />
          </Detalle>
        </Detalles>
        <Totales importeLetra="importe en letra." subTotalFact="100000.26" totaFactura="100000.26" totalFactPesos="100000.26" totalImpTrasPesos="100.64" />
      </Header>
    </Suzuki>
  </cfdi:Addenda>

El error es el siguiente:

PHP Fatal error:  Uncaught TypeError: PhpCfdi\CfdiCleaner\XmlDocumentCleaners\RemoveNonSatNamespacesNodes::isNamespaceRelatedToSat(): Argument #1 ($namespace) must be of type string, null given

Creo que esto sucede por que en el método iterateNonReservedNamespaces de XmlNamespaceMethodsTrait solo esta filtrando los URIs nulos y no los vacíos y para los vacíos el nodeValue es null

Cannot create a DOM Document from xml string XML: Attribute xsi:schemaLocation redefined

Este error se produce cuando se tiene la siguiente estructura en el XML

<cfdi:Comprobante
    xmlns:cfdi="http://www.sat.gob.mx/cfd/3"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd"
    xmlns:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd"
    Version="3.3"
/>

Cuando el proceso limpia el XML, el resultado que se obtiene presenta una segunda definición de xsi:schemaLocation

<?xml version="1.0" encoding="utf-8"?>
<cfdi:Comprobante
    xmlns:cfdi="http://www.sat.gob.mx/cfd/3"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.sat.gob.mx/cfd/3  http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd"
    xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd"
/>

Cfdi4.0 not remove addendas

Este error se produce cuando se tiene un cfdi 4.0 que contiene addendas

<cfdi:Comprobante xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:cfdi="http://www.sat.gob.mx/cfd/4"
    xsi:schemaLocation="http://www.sat.gob.mx/cfd/4 cfdi44.xsd"
    Version="4.0">
    <cfdi:Addenda>
         <o:OtherData xmlns:o="http://tempuri.org/other" foo="bar" />
     </cfdi:Addenda>
</cfdi:Comprobante>

Cuando el proceso limpie el xml, lo esperado es que sea un cfdi sin addendas pero se sigue recibiendo tal cual con addendas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.