diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f0f39809c..362fa1fca 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9426,15 +9426,20 @@ Partial Class Ventas If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Then If DtVentasNC IsNot Nothing Then For Each row As DataRow In DtVentasNC.Rows - If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, row("CveVenta").ToString.ToEntero) Then - ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico") + If Not row("CveVenta").ToString.ToEntero = -1 Then + If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, row("CveVenta").ToString.ToEntero) Then + ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico") + End If End If Next Else - If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then - ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico") + If Not CveVenta = -1 Then + If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then + ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico") + End If End If End If + End If End If