Puntos GDiaz
-- Mostrar precio en ddl lista de precios -- Boton para ver existencias FIX. --Vendedor al facturar remision JAM
This commit is contained in:
@@ -3741,9 +3741,9 @@ Partial Class Ventas
|
||||
Dim Dt As DataTable = Nothing
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(384) Then
|
||||
Dt = ObjVta.DtResultados.FiltraParametros("Predeterminada = 'True'")
|
||||
Dt = ObjVta.DtResultados.Copy()
|
||||
Else
|
||||
Dt = ObjVta.DtResultados.FiltraParametros("Predeterminada = 'True' AND Restringuida = 'False'")
|
||||
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
|
||||
End If
|
||||
|
||||
DdlPrecioLista.DataSource = Dt
|
||||
@@ -8790,6 +8790,10 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
e.Row.FCLinkButton("LnkExistencias").Visible = True
|
||||
End If
|
||||
|
||||
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
|
||||
' e.Row.FCLinkButton("imgE").Enabled = False
|
||||
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
||||
@@ -17933,15 +17937,38 @@ Partial Class Ventas
|
||||
If ObjPrecioSugerido.CvePrecioLista > 0 AndAlso DivPrecioLista.Visible Then
|
||||
DdlPrecioLista.SelectedValueExist(ObjPrecioSugerido.CvePrecioLista)
|
||||
|
||||
If DirectCast(DdlPrecioLista.DataSource, DataTable) IsNot Nothing Then
|
||||
Dim dt = DirectCast(DdlPrecioLista.DataSource, DataTable)
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If DirectCast(DdlPrecioLista.DataSource, DataTable) IsNot Nothing Then
|
||||
Dim dt = DirectCast(DdlPrecioLista.DataSource, DataTable)
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count > 0 Then
|
||||
'CHECA SI EL PRECIO SUGERIDO ESTA EN LA LISTA DE PRECIOS PERMITIDAS
|
||||
If dt.FiltroPrimeroValor("CvePrecioLista", $"CvePrecioLista = {ObjPrecioSugerido.CvePrecioLista}").ToEntero() <= 0 Then
|
||||
If ObjPrecioSugerido.CvePrecioLista = Me.CvePrecioListaCliente Then
|
||||
Alert("La lista de precios del cliente no esta permitido en la sucursal actual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
End If
|
||||
Else
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
|
||||
Alert("No se encontro una lista de precios permitida en la sucursal actual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
|
||||
Alert("No se encontraron listas de precio disponibles", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
'CHECA SI EL PRECIO SUGERIDO ESTA EN LA LISTA DE PRECIOS PERMITIDAS
|
||||
If dt.FiltroPrimeroValor("CvePrecioLista", $"CvePrecioLista = {ObjPrecioSugerido.CvePrecioLista}").ToEntero() <= 0 Then
|
||||
ObjPrecioSugerido.CvePrecioLista = -1
|
||||
ObjPrecioSugerido.PrecioSugerido = 0
|
||||
tPrecioSugerido = 0
|
||||
PrecioSugerido = 0
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -18593,7 +18620,7 @@ Partial Class Ventas
|
||||
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
End If
|
||||
|
||||
CargaListasPreciosSubProyectos(-1)
|
||||
CargaListasPreciosSubProyectos(If(DdlPS.SelectedValue.ToEntero() <= 0, -1, DdlPS.SelectedValue.ToEntero()))
|
||||
|
||||
UpDetalle.Update()
|
||||
UpEmitirTransitorio.Update()
|
||||
@@ -25313,6 +25340,35 @@ Partial Class Ventas
|
||||
RegistraScript("$('#ModalPermisoDesc').modal({backdrop: 'static', keyboard: false});setTimeout(() => {$('#txtUserDesc').focus();}, 500); ", "A2")
|
||||
End If
|
||||
|
||||
ElseIf e.CommandName = "Existencias" Then
|
||||
Dim RowNum As Integer = Convert.ToInt32(e.CommandArgument)
|
||||
Dim GvRow As GridViewRow = GvPS.Rows(RowNum)
|
||||
|
||||
LtlVerExistenciasPS.Text = $"Existencias: {GvRow.DataKey("PS")}"
|
||||
|
||||
Dim RestringirAlmacenes As Integer = -1
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
RestringirAlmacenes = 1 'restringue los almacenes:Consignación,Productos Financieros Asignados,,roductos Financieros,Consumo Interno,Activo Fijo,Merma,Consignación de Contrato,Devolucion proveedor,
|
||||
End If
|
||||
|
||||
Dim BuscarEnTabla As Boolean = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(715) = "1" Then
|
||||
BuscarEnTabla = True
|
||||
End If
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios()
|
||||
If ObjInventarios.GetExistenciasProducto(GvRow.DataKey("CvePS").ToEntero(), -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
|
||||
ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero,
|
||||
ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100, BuscarEnTabla:=BuscarEnTabla) Then
|
||||
GvVerExistencias.DataSource = ObjInventarios.DtResultados.Copy()
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
GvVerExistencias.DataBind()
|
||||
|
||||
UpVerExistencias.Update()
|
||||
|
||||
RegistraScript("$('#DivModalVerExistencias').modal({backdrop: 'static', keyboard: false}); ", "A2")
|
||||
Else
|
||||
DdlPS_SelectedIndexChanged(Nothing, Nothing)
|
||||
End If
|
||||
@@ -32674,7 +32730,6 @@ Partial Class Ventas
|
||||
DdlSubProyectoDatos.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveSubProyecto"))
|
||||
End If
|
||||
DdlSucursalCliente.SelectedValueExist(If(dtSeleccionadas.FiltroPrimeroValor("CveClienteSucursal").ToEntero() > 0, dtSeleccionadas.FiltroPrimeroValor("CveClienteSucursal"), "-1"))
|
||||
DdlVendedor.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveVendedor"))
|
||||
|
||||
CambiaSucursalGeneral()
|
||||
CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
@@ -32702,6 +32757,8 @@ Partial Class Ventas
|
||||
|
||||
RemisionesLista.Clear()
|
||||
|
||||
DdlVendedor.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveVendedor"))
|
||||
|
||||
Dim MsgUsados As New StringBuilder
|
||||
Dim UsadosValidados As Boolean = True
|
||||
|
||||
@@ -38827,5 +38884,12 @@ Partial Class Ventas
|
||||
|
||||
Return "<a href='javascript:void(0);' class='Texto' onclick=''javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact', 800, 547, 'N', 'PopUpBuscar')''> ver </a>"
|
||||
End Function
|
||||
Protected Sub GvVerExistencias_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveAlmacen") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user