Recepcion y vinculacion facturas 4.0
This commit is contained in:
@@ -2845,6 +2845,8 @@ Partial Class Compras_eFacturas
|
||||
|
||||
Dim XMLDoc As New XmlDocument
|
||||
Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
|
||||
|
||||
Dim Prefijo As String = ""
|
||||
If IO.File.Exists(Archivo) Then
|
||||
|
||||
|
||||
@@ -2855,12 +2857,27 @@ Partial Class Compras_eFacturas
|
||||
XMLDoc.LoadXml(SXML)
|
||||
|
||||
Dim Xml As New StringBuilder
|
||||
|
||||
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
|
||||
namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3")
|
||||
Dim RootDocumento As XmlElement = XMLDoc.DocumentElement
|
||||
Dim VersionCFDI As String = ValorXML(RootDocumento, "version")
|
||||
|
||||
If VersionCFDI = "3.3" Then
|
||||
Prefijo = "pago10"
|
||||
namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
|
||||
namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3")
|
||||
ElseIf VersionCFDI = "4.0" Then
|
||||
Prefijo = "pago20"
|
||||
namespaces.AddNamespace("pago20", "http://www.sat.gob.mx/Pagos20")
|
||||
namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/4")
|
||||
End If
|
||||
|
||||
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
|
||||
' namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
|
||||
|
||||
nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
|
||||
|
||||
|
||||
@@ -2868,20 +2885,20 @@ Partial Class Compras_eFacturas
|
||||
|
||||
nodeTFD = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces)
|
||||
|
||||
Dim PrefijoPagos As String = ""
|
||||
'Dim PrefijoPagos As String = ""
|
||||
|
||||
For Each nodoPrefijo As XmlNode In nodeComp.ChildNodes
|
||||
If nodoPrefijo.Prefix <> "tfd" And nodoPrefijo.Prefix.ToUpper.Contains("PAGO") Then
|
||||
PrefijoPagos = nodoPrefijo.Prefix
|
||||
End If
|
||||
Next
|
||||
'For Each nodoPrefijo As XmlNode In nodeComp.ChildNodes
|
||||
' If nodoPrefijo.Prefix <> "tfd" And nodoPrefijo.Prefix.ToUpper.Contains("PAGO") Then
|
||||
' PrefijoPagos = nodoPrefijo.Prefix
|
||||
' End If
|
||||
'Next
|
||||
|
||||
namespaces.AddNamespace(PrefijoPagos, "http://www.sat.gob.mx/Pagos")
|
||||
'namespaces.AddNamespace(PrefijoPagos, "http://www.sat.gob.mx/Pagos")
|
||||
nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
|
||||
|
||||
|
||||
nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", PrefijoPagos), namespaces)
|
||||
nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", PrefijoPagos), namespaces)
|
||||
nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", Prefijo), namespaces)
|
||||
nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", Prefijo), namespaces)
|
||||
|
||||
|
||||
|
||||
@@ -2923,7 +2940,7 @@ Partial Class Compras_eFacturas
|
||||
|
||||
|
||||
Dim nodePagosN As XmlNodeList
|
||||
nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", PrefijoPagos), namespaces)
|
||||
nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", Prefijo), namespaces)
|
||||
|
||||
|
||||
For Each NodosPagos As XmlNode In nodePagosN
|
||||
@@ -2964,7 +2981,7 @@ Partial Class Compras_eFacturas
|
||||
MontoPago = Monto
|
||||
|
||||
Dim ObjCompraFolios As New ClsCompras
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace($"{PrefijoPagos}:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace($"{Prefijo}:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
'
|
||||
'.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
||||
If ObjCompraFolios.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user