--FIX. perdida de info addenda
This commit is contained in:
@@ -12932,6 +12932,49 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'AGREGA LA ADDENDA DESDE AQUI PARA QUE SE GUARDE LA INFORMACION DEL CAMPO
|
||||||
|
If ObjFactura.TipoDocto = "Ing" AndAlso Not String.IsNullOrEmpty(TxtNOS.Text.Trim()) Then
|
||||||
|
Dim Obj_REM As New Modelos.M_REM
|
||||||
|
Obj_REM.NOS = TxtNOS.Text
|
||||||
|
Obj_REM._OR = TxtOR.Text
|
||||||
|
Obj_REM.CLUES = TxtCLUES.Text
|
||||||
|
Obj_REM.CONTRATO = TxtContrato.Text
|
||||||
|
Obj_REM.FEEX = TxtFEEX.Text
|
||||||
|
Obj_REM.FEEN = TxtFEEN.Text
|
||||||
|
Obj_REM.FERE = TxtFERE.Text
|
||||||
|
|
||||||
|
Dim xmlRem As String = ""
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(Obj_REM.GetType)
|
||||||
|
Dim string_writer As New System.IO.StringWriter
|
||||||
|
serializer.Serialize(string_writer, Obj_REM)
|
||||||
|
|
||||||
|
xmlRem = string_writer.ToString()
|
||||||
|
|
||||||
|
'QUITAR NAMESPACES Y ETIQUETAS NO NECESARIAS
|
||||||
|
If xmlRem <> "" Then
|
||||||
|
xmlRem = xmlRem.Replace("<?xml version=""1.0"" encoding=""utf-16""?>", "")
|
||||||
|
xmlRem = xmlRem.Replace("xmlns:xsd=""http://www.w3.org/2001/XMLSchema""", "")
|
||||||
|
xmlRem = xmlRem.Replace("xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""", "")
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
xmlRem = ""
|
||||||
|
OnError("Ocurrió un error al guardar los datos de la addenda", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If Not String.IsNullOrEmpty(xmlRem) Then
|
||||||
|
Dim SB As New StringBuilder
|
||||||
|
SB.Append("<cfdi:Addenda>")
|
||||||
|
SB.AppendFormat("{0}", xmlRem)
|
||||||
|
SB.Append("</cfdi:Addenda>")
|
||||||
|
|
||||||
|
ObjFactura.Addenda = SB.ToString()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CreaObjetosVentaDevolucion()
|
Private Sub CreaObjetosVentaDevolucion()
|
||||||
@@ -13657,47 +13700,6 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(TxtNOS.Text.Trim()) Then
|
|
||||||
Dim Obj_REM As New Modelos.M_REM
|
|
||||||
Obj_REM.NOS = TxtNOS.Text
|
|
||||||
Obj_REM._OR = TxtOR.Text
|
|
||||||
Obj_REM.CLUES = TxtCLUES.Text
|
|
||||||
Obj_REM.CONTRATO = TxtContrato.Text
|
|
||||||
Obj_REM.FEEX = TxtFEEX.Text
|
|
||||||
Obj_REM.FEEN = TxtFEEN.Text
|
|
||||||
Obj_REM.FERE = TxtFERE.Text
|
|
||||||
|
|
||||||
Dim xmlRem As String = ""
|
|
||||||
|
|
||||||
Try
|
|
||||||
Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(Obj_REM.GetType)
|
|
||||||
Dim string_writer As New System.IO.StringWriter
|
|
||||||
serializer.Serialize(string_writer, Obj_REM)
|
|
||||||
|
|
||||||
xmlRem = string_writer.ToString()
|
|
||||||
|
|
||||||
'QUITAR NAMESPACES Y ETIQUETAS NO NECESARIAS
|
|
||||||
If xmlRem <> "" Then
|
|
||||||
xmlRem = xmlRem.Replace("<?xml version=""1.0"" encoding=""utf-16""?>", "")
|
|
||||||
xmlRem = xmlRem.Replace("xmlns:xsd=""http://www.w3.org/2001/XMLSchema""", "")
|
|
||||||
xmlRem = xmlRem.Replace("xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""", "")
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
|
||||||
xmlRem = ""
|
|
||||||
End Try
|
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(xmlRem) Then
|
|
||||||
Dim SB As New StringBuilder
|
|
||||||
SB.Append("<cfdi:Addenda>")
|
|
||||||
SB.AppendFormat("{0}", xmlRem)
|
|
||||||
SB.Append("</cfdi:Addenda>")
|
|
||||||
|
|
||||||
Obj.Addenda = SB.ToString()
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return Timbre
|
Return Timbre
|
||||||
|
|||||||
Reference in New Issue
Block a user