diff --git a/Acumuladores/RepAcumuladoresVigencia.aspx b/Acumuladores/RepAcumuladoresVigencia.aspx new file mode 100644 index 000000000..01f7b200e --- /dev/null +++ b/Acumuladores/RepAcumuladoresVigencia.aspx @@ -0,0 +1,98 @@ +<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.master" CodeFile="RepAcumuladoresVigencia.aspx.cs" Inherits="Acumuladores_RepAcumuladoresVigencia" %> + + + + + + + Reporte de Vigencia de Acumuladores + + + + + + + + + + + + + + + + + + + Clasificación: + + + + + + + + Fecha Inicial: + + + + + + + + + + + + + + + Fecha Final: + + + + + + + + + + + + + + + + + + + + + + + " style="display: inline-block; margin-right: -20px; width: 200px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + + + + + + + + + + + + + + + + + + + + + + diff --git a/Acumuladores/RepAcumuladoresVigencia.aspx.cs b/Acumuladores/RepAcumuladoresVigencia.aspx.cs new file mode 100644 index 000000000..6cc28d9bb --- /dev/null +++ b/Acumuladores/RepAcumuladoresVigencia.aspx.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; +using Microsoft.Reporting.WebForms; +using System.Activities.Expressions; + +public partial class Acumuladores_RepAcumuladoresVigencia : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + InicializaValores(); + } + } + + private void InicializaValores() + { + CargaCombos(); + txtFechaI.Text = DateTime.Now.FirstDayOfMonth().AddMonths(-9).ToShortDateString(); + txtFechaF.Text = DateTime.Now.LastDayOfMonth().AddMonths(-6).ToShortDateString(); + UpFiltros.Update(); + } + + private void CargaCombos() + { + CargarCentrosDeCosto(null, DdlSubProyecto, null, LblSubProyecto); + DdlClasificaciones.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa); + DdlClasificaciones.DataBind(); + DdlClasificaciones.Items.Insert(0, new ListItem("Todos", "-1")); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + Consulta(); + } + + private void Consulta() + { + ClsAcumuladores ObjAcum = new ClsAcumuladores(); + + if (ObjAcum.GetVigencias(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlClasificaciones.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero())) + { + GvAcum.DataSource = ObjAcum.DtResultados; + } + ObjAcum.Dispose(); + GvAcum.DataBind(); + UpDatos.Update(); + } + + /*protected void GvAcum_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + if (e.Row.RowIndex == 0) + { + e.Row.Cells[0].Text = "Total"; + e.Row.CssClass = "Totales"; + } + } + }*/ +} \ No newline at end of file diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 1fbcf36dd..354172fa2 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -1312,11 +1312,35 @@ Public Class ClsAcumuladores End Try Return Retorno - End Function - - + End Function + +#Region "VIGENCIA ACUMULADORES" + Public Function GetVigencias(FechaInicio As Date, FechaFin As Date, CveClasificacion As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean + Dim Retorno As Boolean = False + SqlDataAdapter("PA_Inv_ProductosFechasComprasSerie") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaIni", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los productos por serie.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + +#End Region + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not disposedValue Then If disposing Then diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index bf0830527..6458bcae7 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9354,6 +9354,8 @@ Public Class ClsPaginas PaginaDict.Add("/Acumuladores/RepEntradasUsadosClientes.aspx".ToUpper(), 543) PaginaDict.Add("/Acumuladores/EntradasUsadosResumenRep.aspx".ToUpper(), 1032) PaginaDict.Add("/Acumuladores/RepPolizasVirtuales.aspx".ToUpper(), 1322) + PaginaDict.Add("/Acumuladores/RepAcumuladoresVigencia.aspx".ToUpper(), 174) + #End Region 'Antes de aquí. Application("GlobalSIGAppPaginas") = PaginaDict