From 4a6a7a511d09bc59583471ba44375d5e59147454 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 6 Jun 2022 18:23:53 -0700 Subject: [PATCH] =?UTF-8?q?--=20lectura=20de=20la=20versi=C3=B3n=20generac?= =?UTF-8?q?i=C3=B3n=20de=20carta=20porte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/PopUpVerFactura.aspx.vb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 2c3283f4a..99d538c9a 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1713,8 +1713,13 @@ Partial Class PopUpVerFactura Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) + Dim Version = ValorXML(XMLDoc.DocumentElement, "version") + If Version = "3.3" Then + cfdVer = "http://www.sat.gob.mx/cfd/3" + Else ' se considera que es la version 4.0 + cfdVer = "http://www.sat.gob.mx/cfd/4" + End If - If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" namespaces.AddNamespace(Prefijo, cfdVer) namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") @@ -1722,6 +1727,7 @@ Partial Class PopUpVerFactura namespaces.AddNamespace("cartaporte", "http://www.sat.gob.mx/CartaPorte") namespaces.AddNamespace("cartaporte20", "http://www.sat.gob.mx/CartaPorte20") + Dim nodeComprobante As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", Prefijo), namespaces) If nodeComprobante IsNot Nothing Then LugarExpedicion = ValorXML(nodeComprobante, "LugarExpedicion") @@ -1755,7 +1761,7 @@ Partial Class PopUpVerFactura End If - Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces) + Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante/{0}:Complemento", Prefijo), namespaces) Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte20"), namespaces) If nodeCartaPorte IsNot Nothing Then