diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 0a3410f83..65c7ac3e5 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -3295,6 +3295,32 @@ Public Class ClsCompras End Function + Public Function GetRepSATSolicitudesRecibidas(CveEmpresa As Integer, FechaInicio As Date, FechaFin As DateTime, Opcion As Integer, Vista As Integer) As Boolean + + Dim retorno As Boolean = False + Try + DataAdapter("PA_SAT_SolicitudesRecibidasRepGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@Vista", SqlDbType.Int).Value = Vista + End With + SqlAdapter.Fill(Data) + + retorno = True + + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al consultar el reporte de CFDI contra compras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return retorno + + + End Function + End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 4757d6158..0d9ee6648 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8545,6 +8545,7 @@ Public Class ClsPaginas PaginaDict.Add("/OI/CircularDetalle.aspx".ToUpper(), 756) PaginaDict.Add("/OI/CircularDetalleB.aspx".ToUpper(), 756) PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759) + PaginaDict.Add("/SAT/SolicitudesRecibidasSAT.aspx".ToUpper(), 1339) #End Region #Region "Contabilidad" PaginaDict.Add("/Contabilidad/ContabilidadElectronica.aspx".ToUpper(), 566) diff --git a/SAT/SolicitudesRecibidasSAT.aspx b/SAT/SolicitudesRecibidasSAT.aspx new file mode 100644 index 000000000..8f9aaaf2b --- /dev/null +++ b/SAT/SolicitudesRecibidasSAT.aspx @@ -0,0 +1,478 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SolicitudesRecibidasSAT.aspx.vb" Inherits="SAT_SolicitudesRecibidasSAT" %> + + + + + + + + Comparativo compras + + + + + + +
  • + Excel +
  • +
    + + + +
    +
    + + + + + +
    +
    +
    +
    + +
    + + + + + +
    + +
    +
    + + + + + + + + +
    +
    + +
    + <%----%> +
    + + + + + + + + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    + + + diff --git a/SAT/SolicitudesRecibidasSAT.aspx.vb b/SAT/SolicitudesRecibidasSAT.aspx.vb new file mode 100644 index 000000000..8c8e6834b --- /dev/null +++ b/SAT/SolicitudesRecibidasSAT.aspx.vb @@ -0,0 +1,222 @@ +Imports Extensiones + +Partial Class SAT_SolicitudesRecibidasSAT + Inherits ClsPaginas + + Public Property clasegrid As String + Get + + If ViewState("clasegrid") Is Nothing Then + Return "" + Else + Return ViewState("clasegrid").ToString() + End If + End Get + Set(ByVal value As String) + ViewState("clasegrid") = value + End Set + End Property + + Public Property fechaInicio As String + Get + + If ViewState("fechaInicio") Is Nothing Then + Return "" + Else + Return ViewState("fechaInicio").ToString() + End If + End Get + Set(ByVal value As String) + ViewState("fechaInicio") = value + End Set + End Property + + Public Property fechaFin As String + Get + + If ViewState("fechaFin") Is Nothing Then + Return "" + Else + Return ViewState("fechaFin").ToString() + End If + End Get + Set(ByVal value As String) + ViewState("fechaFin") = value + End Set + End Property + + Public Property TipoDescarga As Integer + Get + + If ViewState("TipoDescarga") Is Nothing Then + Return 0 + Else + Return ViewState("TipoDescarga").ToString().ToEntero() + End If + End Get + Set(ByVal value As Integer) + ViewState("TipoDescarga") = CInt(value) + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + TxtRpdFechaInicio.Text = String.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1)) + TxtRpdFechaFin.Text = String.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()) + End If + + End Sub + + + Protected Sub LnkDownloadExcel_Click(sender As Object, e As EventArgs) + If TipoDescarga = 1 Then + GvResumen.ExportToExcel2($"Resumen{DateTime.Now.ToString("yyyyMMddhhmmss")}") + End If + + If TipoDescarga = 2 Then + GvDatos.ExportToExcel2($"PorComprobante{DateTime.Now.ToString("yyyyMMddhhmmss")}") + End If + End Sub + Protected Sub GvResumen_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DataKey("Fecha") = "" Then + e.Row.Attributes.Add("class", "Totales") + End If + End If + End Sub + Protected Sub GvDatos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DataKey("UUID") = "Totales" Then + e.Row.Font.Bold = True + e.Row.Cells(1).Text = e.Row.DataKey("CountRegistrosSIG") + e.Row.Cells(2).Text = e.Row.DataKey("CountRegistrosSAT") + e.Row.Attributes.Add("class", "Totales") + End If + + If e.Row.DataKey("UUID").ToUpper() <> "TOTALES" Then + Dim SBMsgToolTip As StringBuilder = New StringBuilder() + + If e.Row.DataKey("DifImporte").ToDecimal() <> 0 OrElse (e.Row.DataKey("Abreviatura").ToUpper().Trim() <> e.Row.DataKey("CBTMoneda").ToUpper().Trim()) Then + e.Row.CssClass = "bg-yellow-casablanca bg-font-yellow-casablanca" + End If + + e.Row.Attributes.Add("data-html", "true") + e.Row.Attributes.Add("data-toggle", "tooltip") + e.Row.Attributes.Add("data-placement", "top") + + If e.Row.DataKey("Sistema").ToUpper() = "NO" OrElse e.Row.DataKey("CFDIData").ToUpper() = "NO" Then + + If e.Row.DataKey("Sistema").ToUpper() = "NO" Then + SBMsgToolTip.AppendLine("Comprobante no se encuentra en SIG.
    ") + End If + + If e.Row.DataKey("CFDIData").ToUpper() = "NO" Then + SBMsgToolTip.AppendLine("Comprobante no encontrado.
    ") + End If + Else + + If e.Row.DataKey("DifImporte").ToDecimal() <> 0 Then + SBMsgToolTip.AppendLine($" Diferencia importes {e.Row.DataKey("DifImporte").ToDecimal().ToString("###,###,###.00")}") + End If + + If e.Row.DataKey("Abreviatura").ToUpper().Trim() <> e.Row.DataKey("CBTMoneda").ToUpper().Trim() Then + SBMsgToolTip.AppendLine($"Diferencia en monedas.") + End If + End If + + If SBMsgToolTip.ToString().Length > 0 Then + e.Row.Attributes.Add("title", SBMsgToolTip.ToString()) + End If + + Dim LnkCFDIData As LinkButton = e.Row.FCLinkButton("LnkCFDIData") + + If (e.Row.DataKey("CFDIData").ToUpper() = "SI") Then + ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkCFDIData) + LnkCFDIData.CssClass = "Texto" + Else + LnkCFDIData.PostBackUrl = "#" + End If + End If + End If + + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells(1).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(2).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(3).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(4).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(5).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(6).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(7).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(8).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(9).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(10).BackColor = System.Drawing.Color.FromName("#3598dc") + e.Row.Cells(11).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(12).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(13).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(14).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(15).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(16).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(17).BackColor = System.Drawing.Color.FromName("#C46B06") + e.Row.Cells(1).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(2).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(3).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(4).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(5).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(6).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(7).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(8).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(9).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(10).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(11).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(12).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(13).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(14).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(15).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(16).ForeColor = System.Drawing.Color.FromName("white") + e.Row.Cells(17).ForeColor = System.Drawing.Color.FromName("white") + End If + End Sub + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + DvDatos1.Visible = False + DvDatos2.Visible = False + DVResumen1.Visible = False + DVResumen2.Visible = False + + TipoDescarga = 0 + + LnkDownloadExcel.Visible = False + + If (DdlReporte.SelectedValue.ToEntero() = 1 OrElse DdlReporte.SelectedValue.ToEntero() = 3) Then + DVResumen1.Visible = True + DVResumen2.Visible = True + DvDatos1.Visible = False + DvDatos2.Visible = False + Else + DVResumen1.Visible = False + DVResumen2.Visible = False + DvDatos1.Visible = True + DvDatos2.Visible = True + End If + + Using ObjCompras As New ClsCompras + If ObjCompras.GetRepSATSolicitudesRecibidas(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDate(), TxtRpdFechaFin.Text.ToDate(), DdlReporte.SelectedValue.ToEntero(), -1) Then + If DdlReporte.SelectedValue.ToEntero() = 1 OrElse DdlReporte.SelectedValue.ToEntero() = 3 Then + GvResumen.DataSource = ObjCompras.DtResultados + TipoDescarga = If(ObjCompras.DtResultados.Rows.Count > 0, 1, 0) + LnkDownloadExcel.Visible = True + ElseIf DdlReporte.SelectedValue.ToEntero() = 2 Then + GvDatos.DataSource = ObjCompras.DtResultados + TipoDescarga = If(ObjCompras.DtResultados.Rows.Count > 0, 2, 0) + LnkDownloadExcel.Visible = True + End If + End If + End Using + + GvResumen.DataBind() + GvDatos.DataBind() + UpDatos.Update() + UpAcciones.Update() + End Sub +End Class