This commit is contained in:
rmolina
2019-12-10 19:03:08 -07:00
parent 8668218f75
commit a7bcd1a07d
16 changed files with 235 additions and 68 deletions

View File

@@ -73,18 +73,27 @@ Partial Class Ventas_ActualizarPrecios
DDlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Public Sub CargaPreciosLista()
Public Sub CargaPreciosLista()
DdlPrecioLista.ITEMS.CLEAR
Dim ObjVta As New ClsVentas
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
End If
ObjVta.Dispose()
ObjVta.Dispose()
DdlPrecioLista.DataBind()
DdlPrecioListaCarga.DataBind()
DdlPrecioListaCarga.DataBind()
DdlPrecioLista.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.CveEmpresa.Contiene(1, 140) Then
DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
End If
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Public Sub CargaPS()
@@ -193,7 +202,7 @@ Partial Class Ventas_ActualizarPrecios
ObjPS.Dispose()
BtnConsultar_Click(Nothing, Nothing)
RegistraScript("$('#divAgregar').modal('hide')")
RegistraScript("$('#divAgregar').modal('hide')")
TxtImporte.Text = ""
TxtPrecio.Text = ""
TxtPorcentaje.Text = ""
@@ -271,7 +280,7 @@ Partial Class Ventas_ActualizarPrecios
.PS = row.DataKey("PS"),
.Precio = row.FCTextBox("TxtPrecio").Text.ToDecimal()
}).QueryToDataTable(True)
If DtExcel.Rows.Count < 2 Then
If DtExcel.Rows.Count < 1 Then
Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -350,7 +359,7 @@ Partial Class Ventas_ActualizarPrecios
End Try
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
If DdlPrecioListaCarga.SelectedValue.ToEntero() <= 0 Then
If DdlPrecioListaCarga.SelectedValue.ToEntero() = -1 Then
Alert("Debe Seleccionar la lista de precios a cargar. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
@@ -380,16 +389,26 @@ Partial Class Ventas_ActualizarPrecios
Dim Correcto As Boolean = False
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa))
Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero()
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
Dim Porcentaje As Decimal = -1
If CvePS > 0 AndAlso CvePrecioLista > 0 Then
Dim Porcentaje As Decimal = -1
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
If CvePS > 0 AndAlso CvePrecioLista > 0 Then
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
If Correcto Then
RowsCargados += 1
End If
Else
Correcto = False
Else
If CvePS > 0 AndAlso CvePrecioLista = -2 Then
Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
If Correcto Then
RowsCargados += 1
End If
Else
Correcto = False
End If
End If
If Not Correcto Then
ProductosNoCargados.AppendFormat("{0},", row("Producto / Servicio").ToString())