From 70321b772928489bb67ea202e2436c635d55662b Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 20 Jun 2023 16:23:06 -0700 Subject: [PATCH 1/4] -- mejora visual --- Bancos/RepProgramarRecursos.aspx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Bancos/RepProgramarRecursos.aspx b/Bancos/RepProgramarRecursos.aspx index c8073cca1..909bba2e7 100644 --- a/Bancos/RepProgramarRecursos.aspx +++ b/Bancos/RepProgramarRecursos.aspx @@ -3,7 +3,14 @@ <%@ Import Namespace="Extensiones" %> - + + + 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