diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index ffc42ca94..de094ebf7 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -1470,7 +1470,7 @@ Partial Class ProductosyServicios Exit Sub End If - If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso ChkAplicaParaVenta.Checked Then + If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso ChkAplicaParaVenta.Checked AndAlso DivListaPrecios.Visible Then Dim tcontador As Integer = 0 For Each GvRow As GridViewRow In GvPLMultiple.Rows Dim CvePrecioLista As Integer = GvRow.DataKey("CvePrecioLista").ToEntero() @@ -3012,13 +3012,12 @@ Partial Class ProductosyServicios If UsuarioActual.TienePermisoProceso(389) Then 'si puede actualizar precios se muestra Dim objPS As New ClsProductosServicios If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, -1, CvePS:=CvePS) Then - GvPLMultiple.DataSource = objPS.DtResultados + GvPLMultiple.DataSource = objPS.DtResultados.Copy() End If objPS.Dispose() - DivListaPrecios.Visible = True GvPLMultiple.DataBind() + DivListaPrecios.Visible = True End If - End Sub Protected Sub GvMultiple_RowDataBound(sender As Object, e As GridViewRowEventArgs) @@ -3035,16 +3034,19 @@ Partial Class ProductosyServicios Dim TieneError As Boolean = False Try - For Each GvRow As GridViewRow In GvPLMultiple.Rows - Dim CvePrecioLista As Integer = GvRow.DataKey("CvePrecioLista").ToEntero() - Dim Precio As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal() + If DivListaPrecios.Visible Then + For Each GvRow As GridViewRow In GvPLMultiple.Rows + Dim CvePrecioLista As Integer = GvRow.DataKey("CvePrecioLista").ToEntero() + Dim Precio As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal() - TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True) + TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True) + + If TieneError Then + Exit For + End If + Next + End If - If TieneError Then - Exit For - End If - Next Catch ex As Exception OnError("Ocurrió un error al actualizar precios", ex) TieneError = True diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index dfd33cfbd..a3a4124f2 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14649,7 +14649,7 @@ Partial Class Ventas 'VERIFICA SI BONIFICACION If ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 2)) Then CveTipoVentaGuardar = 7 ' BONIFICACION - ElseIf ListaNCDescuento.Any(Function(RNC) (Not RNC.Num1 = 2)) Then + ElseIf ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 1)) Then CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS End If End If @@ -14658,7 +14658,7 @@ Partial Class Ventas 'VERIFICA SI BONIFICACION If ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 2)) Then CveTipoVentaGuardar = 7 ' BONIFICACION - ElseIf ListaRemisionesNC.Any(Function(RNC) (Not RNC.Num1 = 2)) Then + ElseIf ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 1)) Then CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS End If End If @@ -37929,6 +37929,7 @@ Partial Class Ventas ObjFacturaProntoPago.DtVentasNC = DtVentasNC ObjFacturaProntoPago.Timbre = PreParaTimbre(ObjFacturaProntoPago) + ObjFacturaProntoPago.CveTipoVenta = 8 Resp = ObjFacturaProntoPago.EmitirFactura(False, Transac:=SqlTransaccion)