diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index bb08cf310..0966d0143 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -133,6 +133,25 @@ Public Class ClsGenerales End With End Sub + Public Function IEPSxEntidadFed(cveEstado As Int32, tasaIEPS As Decimal, fechaInicio As String, fechaFin As String, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_GralIepsPorEntidadFederativa", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveEstado", SqlDbType.Int).Value = (cveEstado) + .Add("@TasaIEPS", SqlDbType.Decimal).Value = (tasaIEPS) + .Add("@FechaInicio", SqlDbType.VarChar).Value = (fechaInicio) + .Add("@FechaFin", SqlDbType.VarChar).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 obtener el reporte de IEPS por entidad federativa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Function RepConciliacionSatDetalleGET(cveEmpresa As Int32, tipoDocto As String, fechaI As String, fechaF As String, RegistroEn As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_RepConciliacionSatDetalleGET", CommandType.StoredProcedure) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 5ce6ad484..731b860f7 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3517,6 +3517,7 @@ Public Class ClsPaginas PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) PaginaDict.Add("/reporteador.aspx".ToUpper(), -1) + PaginaDict.Add("/General/CATIEPSxEntidadFed.aspx".ToUpper(), 719) PaginaDict.Add("/GPS/RepArrastre.aspx".ToUpper(), 718) PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716) diff --git a/General/CATIEPSxEntidadFed.aspx b/General/CATIEPSxEntidadFed.aspx new file mode 100644 index 000000000..59670ee41 --- /dev/null +++ b/General/CATIEPSxEntidadFed.aspx @@ -0,0 +1,118 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CATIEPSxEntidadFed.aspx.cs" Inherits="General_CATIEPSxEntidadFed" %> + + + + + + + + IEPS Por Entidad Federativa + + + + +
  • + Excel +
  • +
    + + + + + +
    +
    +
    + + +
    +
    +
    + +
    + + + + + + +
    + +
    + + +
    +
    + Fecha Inicio +
    +
    +
    + + + + +
    + + + +
    +
    + Fecha Fin +
    +
    +
    + + + + +
    + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + diff --git a/General/CATIEPSxEntidadFed.aspx.cs b/General/CATIEPSxEntidadFed.aspx.cs new file mode 100644 index 000000000..66f2eff2b --- /dev/null +++ b/General/CATIEPSxEntidadFed.aspx.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +public partial class General_CATIEPSxEntidadFed : ClsPaginas +{ + #region Propiedades + private int RcveEstado + { + get { return (ViewState["RcveEstado"] == null) ? 0 : Convert.ToInt32(ViewState["RcveEstado"]); } + set { ViewState["RcveEstado"] = value; } + } + private decimal RtasaIEPS + { + get { return (ViewState["RtasaIEPS"] == null) ? 0 : Convert.ToDecimal(ViewState["RtasaIEPS"]); } + set { ViewState["RtasaIEPS"] = value; } + } + private string RfechaInicio + { + get { return (ViewState["RfechaInicio"] == null) ? "-1": (ViewState["RfechaInicio"]).ToString(); } + set { ViewState["RfechaInicio"] = value; } + } + private string RfechaFin + { + get { return (ViewState["RfechaFin"] == null) ? "-1": (ViewState["RfechaFin"]).ToString(); } + set { ViewState["RfechaFin"] = value; } + } + + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + DdlEstado.DataSource = get_GlobalDTEstado("Mex"); + DdlEstado.DataBind(); + + + DdlEstado.Items.Insert(0, new ListItem("Seleccione", "-1")); + RcveEstado = Request["cveEstado"] == null ? -1 : Request["cveEstado"].ToString().ToEntero(); + RtasaIEPS = Request["tasaIEPS"] == null ? -1 : Request["tasaIEPS"].ToString().ToDecimal(); + RfechaInicio = Request["fechaInicio"] == null ? string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1)) : Request["fechaInicio"].ToString(); + RfechaFin = Request["fechaFin"] == null ? string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()) : Request["fechaFin"].ToString(); + DdlEstado .SelectedValueExist( RcveEstado.ToString()); + DdlIeps.SelectedValueExist ( RtasaIEPS.ToString()); + TxtIEPSfechaInicio.Text = $"{RfechaInicio:dd/MM/yyyy}"; + TxtIEPSfechaFin.Text = $"{RfechaFin:dd/MM/yyyy}"; + + RfechaInicio = RfechaInicio.ToDate().ToString("yyyy/MM/dd"); + RfechaFin = RfechaFin.ToDate().ToString("yyyy/MM/dd"); + CargaIEPSxEntidadFed(); + } + } + protected void CargaIEPSxEntidadFed() + { + ClsGenerales ObjIEPS = new ClsGenerales(); + ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119); + GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados; + ObjIEPS.Dispose(); + GVIEPSxEntidadFed.DataBind(); + upDatosIEPS.Update(); + } + + protected void GVIEPSxEntidadFed_RowDataBound(object sender, GridViewRowEventArgs e) + { + if(e.Row.RowType == DataControlRowType.DataRow) + { + int cveGrupo = e.Row.DBCampo("CveGrupo").ToEntero(); + if (cveGrupo == 1) + { + e.Row.CssClass = "Titulos"; + } + if (cveGrupo == 2) + { + e.Row.CssClass = "Totales"; + } + } + } + protected void BtnIEPSFiltrar_Click(object sender, EventArgs e) + { + + RcveEstado = DdlEstado.SelectedValue.ToEntero(); + RtasaIEPS = DdlIeps.SelectedValue.ToDecimal(); + RfechaInicio = TxtIEPSfechaInicio.Text.ToDate().ToString("yyyy/MM/dd") ; + RfechaFin = TxtIEPSfechaFin.Text.ToDate().ToString("yyyy/MM/dd"); + + CargaIEPSxEntidadFed(); + } + + protected void LnkExcel_Click(object sender, EventArgs e) + { + GVIEPSxEntidadFed.ExportToExcelx("IEPS porEntidad Federativa"); + } +}