diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index f9ff95c6a..98656a00a 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1776,6 +1776,17 @@ Partial Class PV Moneda = 1 End If + 'ELIMINA LOS DETALLES + If Not OcurrioError Then + Dim DtEliminados As DataTable = TmpDT.FiltraParametros("EliminarDB = True AND CveVentaDetalle > 0", "", {"CveVentaDetalle"}) + + For Each Dr1 As DataRow In DtEliminados.Rows + If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then + OcurrioError = True + End If + Next + End If + 'Actualizo los parametros de la venta If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, UsuarioActual.CveEmpresa, CveVenta, 0, 0, @@ -1834,18 +1845,6 @@ Partial Class PV Next End If - - 'ELIMINA LOS DETALLES - If Not OcurrioError Then - Dim DtEliminados As DataTable = TmpDT.FiltraParametros("EliminarDB = True AND CveVentaDetalle > 0", "", {"CveVentaDetalle"}) - - For Each Dr1 As DataRow In DtEliminados.Rows - If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then - OcurrioError = True - End If - Next - End If - 'RECARGA LOS DATOS ObjFactura.Dispose() ObjFactura = Nothing