Rep CxP Detalle / EntradasSalidas: limpiar chequeo de estado personalizado de Grid

- Arregla un bug en CxP donde mostraba la opcion de descargar Excel personalizado sin que el usuario hubiera personalizado el Grid anteriormente
This commit is contained in:
MLopez
2023-01-10 21:30:10 -07:00
parent 782804b7a7
commit be577a924e
4 changed files with 71 additions and 111 deletions

View File

@@ -15,44 +15,45 @@
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server" >
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel ID="UPAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Excel Personalizado</asp:LinkButton>
</li>
<li>
<asp:LinkButton runat="server" ID="LnkPersonalizar" CssClass="" data-toggle="tooltip" Visible="True" OnClick="LnkPersonalizar_Click"
data-placement="left" Text="<i class='fa fa-pencil'></i> Personalizar">
</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Excel Personalizado</asp:LinkButton>
</li>
<li>
<asp:LinkButton runat="server" ID="LnkPersonalizar" CssClass="" data-toggle="tooltip" Visible="True" OnClick="LnkPersonalizar_Click"
data-placement="left" title="Enviar Correo de Prueba" Text="<i class='fa fa-pencil'></i> Personalizar"></asp:LinkButton> </li>
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HplProgramar" runat="server">Programar Recursos</asp:HyperLink>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgImprimir" />
<asp:PostBackTrigger ControlID="ImgExcel" />
<asp:PostBackTrigger ControlID="ImgExcelPersonalizado" />
</Triggers>
</asp:UpdatePanel>
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HplProgramar" runat="server">Programar Recursos</asp:HyperLink>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgImprimir" />
<asp:PostBackTrigger ControlID="ImgExcel" />
<asp:PostBackTrigger ControlID="ImgExcelPersonalizado" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de CxP - Detalle
@@ -216,18 +217,18 @@
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Label runat="server" class="col-md-1" ID="LblProyecto"></asp:Label>
<div class="col-md-1">
<asp:DropDownList ID="DdlProyecto" runat="server" CssClass="select2me" DataTextField="Proyecto" DataValueField="CveProyecto" Width="100%" AutoPostBack="true">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Label runat="server" class="col-md-1" ID="LblSubProyectofiltro"></asp:Label>
<div class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" class="col-md-1" ID="LblProyecto"></asp:Label>
<div class="col-md-1">
<asp:DropDownList ID="DdlProyecto" runat="server" CssClass="select2me" DataTextField="Proyecto" DataValueField="CveProyecto" Width="100%" AutoPostBack="true">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Label runat="server" class="col-md-1" ID="LblSubProyectofiltro"></asp:Label>
<div class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1" style="margin-left:20px"><span>Comprobación:</span></div>
<div class="col-md-1">
@@ -241,19 +242,19 @@
</div>
<div class="row">
<div class="row">
<div class="col-md-1"><span>Moneda:</span></div>
<div class="col-md-1">
<asp:DropDownList ID="Ddlmoneda" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="Moneda" DataValueField="CveMoneda" Width="100%" ></asp:DropDownList>
</div>
<div class="col-md-1">
<asp:DropDownList ID="Ddlmoneda" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="Moneda" DataValueField="CveMoneda" Width="100%" ></asp:DropDownList>
</div>
<div class="col-md-1" style="margin-left:20px"><span>Aplica NC:</span></div>
<div class="col-md-1">
<div class="col-md-1">
<asp:DropDownList ID="DdlAplicaNC" runat="server" CssClass="select2me" AppendDataBoundItems="true" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</asp:DropDownList>
</div>
</div>
</div>
</div>
@@ -264,7 +265,7 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" data-sort="true" Width="99%" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas"
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" data-sort="true" Width="99%" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<%--0--%>

View File

@@ -83,18 +83,6 @@ Partial Class RepCxPDetalle
ViewState("FechaFin") = value
End Set
End Property
Private Property Personalizo As Integer
Get
Return ViewState("Personalizo").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Personalizo") = value
End Set
End Property
Public Property FechaVInicio() As String
Get
@@ -205,7 +193,6 @@ Partial Class RepCxPDetalle
Private Property TCEspecifico As Double
Public Property DTCuentasContables() As DataTable
Get
If ViewState("DTCuentasContables") Is Nothing Then
@@ -218,20 +205,14 @@ Partial Class RepCxPDetalle
Set(value As DataTable)
ViewState("DTCuentasContables") = value
End Set
End Property
End Property
#End Region
'pRivate ReadOnly Property ColumnasVisibles As
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Personalizo = 0
'Private ReadOnly Property ColumnasVisibles As
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
ViewState("Opcion") = IfNull(Request("Op"), "S")
MostrarOcultarColumnas()
MostrarOcultarColumnas(False)
CargaCombos()
If Request("Op") IsNot Nothing Then
CargaDatos()
@@ -274,7 +255,6 @@ Partial Class RepCxPDetalle
DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1"))
DdlUsuarioRegistro.SelectedValueExist(UsuarioRegistro)
Dim CveSucursal As Integer = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
@@ -309,7 +289,6 @@ Partial Class RepCxPDetalle
FechaCorte = IfNull(Request("FechaCorte"), Now.ToDate.ToString).ToString
txtCorteA.Text = $"31/12/{Now.Year}"
If Request("FechaI") <> "-1" AndAlso IsDate(Request("FechaI")) Then txtFechaI.Text = Request("FechaI")
If Request("FechaF") <> "-1" AndAlso IsDate(Request("FechaF")) Then txtFechaF.Text = Request("FechaF")
If Request("FechaVI") <> "-1" AndAlso IsDate(Request("FechaVI")) Then txtFechaVI.Text = Request("FechaVI")
@@ -349,8 +328,6 @@ Partial Class RepCxPDetalle
GvDatos.Columns(11).Visible = (UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0)
For Each lItem As ListItem In DdlGrupo.Items
If lItem.Value.ToEntero = 9 Then
@@ -358,7 +335,6 @@ Partial Class RepCxPDetalle
End If
Next
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
@@ -544,11 +520,8 @@ Partial Class RepCxPDetalle
End If
End If
End If
If e.Row.DBCampo("CveCompra") = "" Then
e.Row.FCLabel("LblMoneda").Text = ""
End If
@@ -595,7 +568,7 @@ Partial Class RepCxPDetalle
#End Region
#Region "PERSONALIZAR"
Protected Sub MostrarOcultarColumnas()
Protected Sub MostrarOcultarColumnas(Optional Personalizo As Boolean = True)
If ChkTipoDocto.Checked Then
GvDatos.Columns(0).Visible = True
@@ -639,15 +612,12 @@ Partial Class RepCxPDetalle
GvDatos.Columns(7).Visible = False
End If
If ChkMoneda.Checked Then
GvDatos.Columns(8).Visible = True
Else
GvDatos.Columns(8).Visible = False
End If
If ChkSaldo.Checked Then
GvDatos.Columns(9).Visible = True
Else
@@ -692,12 +662,12 @@ Partial Class RepCxPDetalle
GvDatos.Columns(16).Visible = ChkDescripcion.Checked
Personalizo = 1
If Personalizo = 1 Then
If Personalizo Then
ImgExcelPersonalizado.Visible = True
Else
ImgExcelPersonalizado.Visible = False
End If
End If
UPAcciones.Update()
UPDatos.Update()
End Sub

View File

@@ -227,7 +227,7 @@
<Columns>
<%--0--%>
<asp:HyperLinkField DataNavigateUrlFields="CvePS,CveMoneda,CveProveedor,CveConcepto,FechaI,FechaF,CveAlmacen,CvePersonal,Tipo" DataNavigateUrlFormatString="~/Inventarios/RepExistenciasCostos.aspx?CvePS={0}&CveMoneda={1}&CveProveedor={2}&CveConcepto={3}&FechaI={4}&FechaF={5}&CveAlmacen={6}&CvePersonal={7}&Tipo={8}" Target="_blank" ItemStyle-Width="10%" HeaderText="Código" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Codigo" />
<asp:HyperLinkField DataNavigateUrlFields="CvePS,CveMoneda,CveProveedor,CveConcepto,FechaI,FechaF,CveAlmacen,CvePersonal,Tipo" DataNavigateUrlFormatString="~/Inventarios/RepExistenciasCostos.aspx?CvePS={0}&CveMoneda={1}&CveProveedor={2}&CveConcepto={3}&FechaI={4}&FechaF={5}&CveAlmacen={6}&CvePersonal={7}&Tipo={8}" Target="_blank" ItemStyle-Width="10%" HeaderText="Código" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Codigo" />
<%--1--%>
<asp:HyperLinkField DataNavigateUrlFields="CvePS,CveMoneda,CveProveedor,CveConcepto,FechaI,FechaF,CveAlmacen,CvePersonal,Tipo" DataNavigateUrlFormatString="~/Inventarios/RepExistenciasCostos.aspx?CvePS={0}&CveMoneda={1}&CveProveedor={2}&CveConcepto={3}&FechaI={4}&FechaF={5}&CveAlmacen={6}&CvePersonal={7}&Tipo={8}" Target="_blank" ItemStyle-Width="10%" HeaderText="Código2" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" Visible="False" DataTextField="Codigo2" />
<%--2--%>

View File

@@ -54,21 +54,11 @@ Partial Class Inventarios_ReporteEntradasSalidas
Return (UsuarioActual.CveEmpresa.Contiene(72, 80))
End Get
End Property
Private Property Personalizo As Integer
Get
Return ViewState("Personalizo").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Personalizo") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
Personalizo = 0
If UsuarioActual.CveEmpresa.Contiene(119) Then
LnkFormatoInventario.Visible = True
@@ -435,7 +425,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
#End Region
#Region "PERSONALIZAR"
Private Sub MostrarOcultarColumnas()
Private Sub MostrarOcultarColumnas(Optional Personalizo As Boolean = True)
GvM.Columns(1).Visible = ChkCodigoAlterno.Checked
GvM.Columns(2).Visible = ChkCodigoBarras.Checked
GvM.Columns(3).Visible = ChkClasificacion2.Checked
@@ -510,12 +500,12 @@ Partial Class Inventarios_ReporteEntradasSalidas
dvCan.Style.Add("width", "21%")
End If
Personalizo = 1
If Personalizo = 1 Then
If Personalizo Then
LnkExcelPersonalizado.Visible = True
Else
LnkExcelPersonalizado.Visible = False
End If
UPAcciones.Update()
UpEncabezado.Update()
UPPMov.Update()
@@ -524,7 +514,6 @@ Partial Class Inventarios_ReporteEntradasSalidas
Private Sub BtnPersonalizar_Click(sender As Object, e As EventArgs) Handles BtnPersonalizar.Click
MostrarOcultarColumnas()
RegistraScript("$('#DivPersonalizar').modal('hide')")
UPAcciones.Update()
'CargaDatos()
End Sub