diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7934900a7..571d29650 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12932,6 +12932,49 @@ Partial Class Ventas 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("", "") + 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("") + SB.AppendFormat("{0}", xmlRem) + SB.Append("") + + ObjFactura.Addenda = SB.ToString() + End If + + End If + End Sub Private Sub CreaObjetosVentaDevolucion() @@ -13657,47 +13700,6 @@ Partial Class Ventas 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("", "") - 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("") - SB.AppendFormat("{0}", xmlRem) - SB.Append("") - - Obj.Addenda = SB.ToString() - End If - - - End If - End If Return Timbre