From 61da15c530375686fda3091f41fdbe87b9ff05b8 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 26 Oct 2020 13:54:23 -0700 Subject: [PATCH] haciendo pull --- App_Code/ClsInventarios.vb | 52 ++++++++++++++ App_Code/ClsPaginas.vb | 1 + Inventarios/Kardex.aspx | 40 +++++++++++ Inventarios/Kardex.aspx.vb | 21 ++++++ Inventarios/RepProductosPorCaducar.aspx | 83 ++++++++++++++++++++++ Inventarios/RepProductosPorCaducar.aspx.cs | 63 ++++++++++++++++ Inventarios/TraspasoAlmacen.aspx.vb | 1 + 7 files changed, 261 insertions(+) create mode 100644 Inventarios/RepProductosPorCaducar.aspx create mode 100644 Inventarios/RepProductosPorCaducar.aspx.cs diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 699faf04e..24520e128 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1588,6 +1588,58 @@ Public Class ClsInventarios End Function + Public Function GetExistenciasCaducidad(CvePS As Integer, CveAlmacen As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveAlmacenes As String = "-1") As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ExistenciaCaducidadGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.VarChar).Value = CveAlmacen + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacenes", SqlDbType.VarChar).Value = CveAlmacenes + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al obtener el kardex de almacen.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al obtener el kardex de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + Public Function GetProductosCaducidad(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveClasificacion As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ProductosCaducidadGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el listo de caducidad de productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + #End Region #Region " INVENTARIOS - REPORTES " diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 8fe10c062..b48153412 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3783,6 +3783,7 @@ Public Class ClsPaginas PaginaDict.Add("/Contratos/Contrato2.aspx".ToUpper(), -1) PaginaDict.Add("/Flotillas/CatMantenimientos.aspx".ToUpper(), -1) PaginaDict.Add("/Inventarios/PaqueteDetalles.aspx".ToUpper(), -1) + PaginaDict.Add("/Inventarios/RepProductosPorCaducar.aspx".ToUpper(), 693) diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx index d3d08e46b..b8f4344fc 100644 --- a/Inventarios/Kardex.aspx +++ b/Inventarios/Kardex.aspx @@ -127,6 +127,9 @@
  • Series Disponibles
  • +
  • + Caducidad de producto +
  •  
  • @@ -538,6 +541,43 @@ + + + diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index f2f961c3b..039649bac 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -205,7 +205,9 @@ Partial Class Inventarios_Kardex If AplicaCaducidad Then GvM.Columns(10).Visible = True Dim AuxAplicaSerie As Boolean = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaSerie") = "True" + Dim AuxAplicaCad As Boolean = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaCaducidad") = "True" LnkSeries.Visible = AuxAplicaSerie + LnkCaducidad.Visible = AuxAplicaCad 'CARGA INDICADORES If UsuarioActual.TienePermisoProceso(201) Then DivIndicadores.Visible = True @@ -324,6 +326,19 @@ Partial Class Inventarios_Kardex ObjInventarios.Dispose() GvSeries.DataBind() End Sub + + Private Sub CargarCaducidadProducto() + Dim almacenes As String = ddlAlmacen.GetSelectedValues() + If almacenes = "" Then + almacenes = "-1" + End If + Dim ObjInventarios As New ClsInventarios + If ObjInventarios.GetExistenciasCaducidad(ddlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then + GvProductoCaducidad.DataSource = ObjInventarios.DtResultados + End If + ObjInventarios.Dispose() + GvProductoCaducidad.DataBind() + End Sub #End Region #Region " IMPRIMIR " @@ -440,6 +455,12 @@ Partial Class Inventarios_Kardex UpGridSeries.Update() RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalSerie")) End Sub + + Protected Sub LnkCaducidad_OnClick(sender As Object, e As EventArgs) Handles LnkCaducidad.Click + CargarCaducidadProducto() + UpProductoCaducidad.Update() + RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalCaducidad")) + End Sub #End Region diff --git a/Inventarios/RepProductosPorCaducar.aspx b/Inventarios/RepProductosPorCaducar.aspx new file mode 100644 index 000000000..eb7484e0d --- /dev/null +++ b/Inventarios/RepProductosPorCaducar.aspx @@ -0,0 +1,83 @@ +<%@ Page Title="Compras - Reporte de Productos por Caducar" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepProductosPorCaducar.aspx.cs" Inherits="Inventarios_RepProductosPorCaducar" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Reporte de Productos por Caducar + + + + + + +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + +
    + + diff --git a/Inventarios/RepProductosPorCaducar.aspx.cs b/Inventarios/RepProductosPorCaducar.aspx.cs new file mode 100644 index 000000000..a25961a9d --- /dev/null +++ b/Inventarios/RepProductosPorCaducar.aspx.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class Inventarios_RepProductosPorCaducar : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //CargaFiltros(); + } + } + + private void CargaFiltros() + { + CargarProveedores(); + CargarSucursales(); + CargarClasificaciones(); + + } + + private void CargarProveedores() + { + DdlProveedor.setEsWebService(true); + DdlProveedor.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedor.SelectedValue = "-1"; + DdlProveedor.SelectedText = "Todos"; + } + + private void CargarSucursales() + { + ClsSubProyectos ObjSubProyectos = new ClsSubProyectos(); + if (ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa)) + { + DdlSucursal.DataSource = ObjSubProyectos.DtResultados; + } + ObjSubProyectos.Dispose(); + DdlSucursal.DataBind(); + } + + private void CargarClasificaciones() + { + ClsClasificaciones ObjClasificacion = new ClsClasificaciones(); + if (ObjClasificacion.GetClasificaciones(UsuarioActual.CveEmpresa)) + { + DdlClasificacion.DataSource = ObjClasificacion.DtResultados; + } + ObjClasificacion.Dispose(); + DdlClasificacion.DataBind(); + DdlClasificacion.Items.Insert(0,new ListItem("Todos","-1")); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 84853dda9..11c12d868 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1310,6 +1310,7 @@ Partial Class Inventarios_TraspasoAlmacen GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> "" GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> "" + GvDatos.Columns(7).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad") GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0