--Addenda en ventas, guardar, lectura y escritura en xml
This commit is contained in:
1283
Ventas/Ventas.aspx
1283
Ventas/Ventas.aspx
File diff suppressed because it is too large
Load Diff
@@ -6255,6 +6255,38 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim Addenda = DbRowVenta("Addenda").ToString()
|
||||
If Not String.IsNullOrEmpty(Addenda) Then
|
||||
Try
|
||||
Dim ObjAddenda As New Modelos.M_REM
|
||||
|
||||
Addenda = Addenda.Replace("<cfdi:Addenda>", "")
|
||||
Addenda = Addenda.Replace("</cfdi:Addenda>", "")
|
||||
|
||||
Dim strAddenda As New StringBuilder()
|
||||
strAddenda.Append("<?xml version=""1.0""?>")
|
||||
strAddenda.Append(Addenda)
|
||||
|
||||
Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(ObjAddenda.GetType())
|
||||
Dim string_reader As TextReader = New System.IO.StringReader(strAddenda.ToString())
|
||||
|
||||
ObjAddenda = DirectCast(serializer.Deserialize(string_reader), Modelos.M_REM)
|
||||
|
||||
If ObjAddenda IsNot Nothing Then
|
||||
TxtNOS.Text = ObjAddenda.NOS
|
||||
TxtOR.Text = ObjAddenda._OR
|
||||
TxtCLUES.Text = ObjAddenda.CLUES
|
||||
TxtContrato.Text = ObjAddenda.CONTRATO
|
||||
TxtFEEX.Text = ObjAddenda.FEEX
|
||||
TxtFERE.Text = ObjAddenda.FERE
|
||||
TxtFEEN.Text = ObjAddenda.FEEN
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar los datos de la addenda", ex)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
@@ -13624,6 +13656,48 @@ 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("<?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
|
||||
|
||||
Return Timbre
|
||||
@@ -14163,7 +14237,7 @@ Partial Class Ventas
|
||||
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible,
|
||||
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta,
|
||||
CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir,
|
||||
Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveMotivoDevolucion:=CveMotivoDevolucion) Then
|
||||
Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveMotivoDevolucion:=CveMotivoDevolucion, Addenda:=factura.Addenda) Then
|
||||
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
Else
|
||||
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
|
||||
@@ -39177,6 +39251,5 @@ Partial Class Ventas
|
||||
' End Sub
|
||||
'End Class
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user