@@ -899,12 +898,25 @@
for (var i = 0; i < checks.length; i++) {
if (checks[i].type == "checkbox") {
- debugger;
-
if (checks[i].checked) {
- idd = checks[i].id.replace('C_GVPrecios_chkPS_', '')
+ idd = checks[i].id.replace('C_GVPrecios_chkPS_', '');
if ($get('C_GVPrecios_TxtPrecio_' + idd) != null) {
- $get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2);
+ let tipo = $get('HdnTipo').value;
+
+ //ASIGNAR PRECIO NUEVO
+ if (tipo == '1') {
+ $get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2);
+ }
+
+ //AUMENTAR PRECIO POR PORCENTAJE
+ if (tipo == '2') {
+ let precioActual = ToDouble($get('C_GVPrecios_LtlPrecio_' + idd).innerText.replace(" ", "").replace("$", "").replace(",",""));
+
+ let precioNuevo = ToDouble(((valor / 100) * precioActual) + precioActual)
+ $get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(precioNuevo, 2);
+ }
+
+
}
}
diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb
index 3aaa0ed3a..f30e1a2a1 100644
--- a/Ventas/ActualizarPrecios.aspx.vb
+++ b/Ventas/ActualizarPrecios.aspx.vb
@@ -333,21 +333,25 @@ Partial Class Ventas_ActualizarPrecios
End Sub
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs)
If RblTipo.SelectedValue = "Imp" Then
- ImporteFijo.Visible = True
+ LtlImporte.Text = "Precio nuevo:"
+ LtlSimbolo.Text = "$"
+ HdnTipo.Value = "1"
Else
- ImporteFijo.Visible = False
+ LtlImporte.Text = "Porcentaje a incrementar:"
+ LtlSimbolo.Text = "%"
+ HdnTipo.Value = "2"
End If
UPPrecioLista.Update()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
- If RblTipo.SelectedIndex = 1 And TxtPorcentaje.Text.ToDecimal = 0 Then
- Alert("Se debe de especificar un porcentaje.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
+ 'If RblTipo.SelectedIndex = 1 And TxtPorcentaje.Text.ToDecimal = 0 Then
+ ' Alert("Se debe de especificar un porcentaje.", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
Dim TieneError As Boolean = False
'Dim Importe As Decimal = If(TxtImporte.Text = "", -1, TxtImporte.Text.ToDecimal)
- Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
+ Dim Porcentaje As Decimal = -1 ' If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
Dim MensajeAlert As New StringBuilder
Dim sbProductos As New StringBuilder
@@ -356,7 +360,7 @@ Partial Class Ventas_ActualizarPrecios
Try
For Each row As GridViewRow In GVPrecios.Rows
If row.FCCheckBox("chkPS").Checked Then
- TieneError = Not ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
+ TieneError = Not ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), True, PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
If CBool(row.DataKey("ProductoExhibicion")) Then
sbProductos.AppendFormat("{0},", row.DataKey("CvePS").ToEntero)
End If
@@ -396,7 +400,7 @@ Partial Class Ventas_ActualizarPrecios
RegistraScript("$('#divAgregar').modal('hide')")
TxtImporte.Text = ""
TxtPrecio.Text = ""
- TxtPorcentaje.Text = ""
+ 'TxtPorcentaje.Text = ""
End Sub
#Region "MODAL PRECIOS MINIMOS"
@@ -679,8 +683,8 @@ Partial Class Ventas_ActualizarPrecios
Dim StrMsgError As New StringBuilder
If FranquiciasStr <> "" Then
Dim Franquicias As String() = FranquiciasStr.Split(","c)
- Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
-
+ Dim Porcentaje As Decimal = -1 ' If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
+
For Each Franquicia As String In Franquicias
Dim CveFranquicia As Integer = Franquicia.ToEntero
Dim CvePS As Integer = GlobalDTPSSimplificado(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero