From a40c5b9cb9b0f4da22ebe58ebfd73e25949d9f22 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 14 Mar 2025 11:56:03 -0700 Subject: [PATCH] Reporte de Pedidos liga a venta si tiene permiso, RepAlmacen obs grupo medico, KArdex Almacen horizontal fix segunda consulta --- App_Code/ClsInventarios.vb | 3 ++- Inventarios/KardexAlmacenHorizontal.aspx | 2 +- Inventarios/KardexAlmacenHorizontal.aspx.vb | 11 ++++++-- Inventarios/RepAlmacen.aspx | 29 +++++++++++++++++---- Inventarios/RepAlmacen.aspx.vb | 26 +++++++++++++++--- Ventas/RepPedidosSTF.aspx | 3 ++- Ventas/RepPedidosSTF.aspx.vb | 17 ++++++++++++ 7 files changed, 77 insertions(+), 14 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index e0e8b665d..f014d0ed2 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -325,7 +325,7 @@ Public Class ClsInventarios End Function Public Function GetRepAlmacenes(FechaInicio As String, FechaFin As String, CveEmpresa As Integer, CveTipoAlmacen As String, Contabilizable As Integer, Inventariable As Integer, Optional SoloMovimientosContables As Boolean = False, Optional Almacenes As String = "-1", Optional CveSubProyecto As Integer = -1, - Optional CveUsuarioConsulta As Integer = -1) As Boolean + Optional CveUsuarioConsulta As Integer = -1, Optional Gpo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_AlmacenesRepGet") @@ -340,6 +340,7 @@ Public Class ClsInventarios .Add("@Almacenes", SqlDbType.VarChar).Value = Almacenes .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@Gpo", SqlDbType.Int).Value = Gpo End With Try SqlAdapter.Fill(Data) diff --git a/Inventarios/KardexAlmacenHorizontal.aspx b/Inventarios/KardexAlmacenHorizontal.aspx index 164c6990a..2d344c96a 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx +++ b/Inventarios/KardexAlmacenHorizontal.aspx @@ -348,7 +348,7 @@ table.adssigscroll { " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - +
diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index bc9f5654a..39b1117ca 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -161,6 +161,9 @@ Partial Class Inventarios_KardexAlmacenHorizontal End Sub Private Sub CargarKardex(CvePS As Integer) + 'GvDatos.Columns.Clear() + 'GvDatos.AutoGenerateColumns = True + Dim dt As New DataTable Dim ObjMovimientos As New ClsInventarios Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1") @@ -202,13 +205,16 @@ Partial Class Inventarios_KardexAlmacenHorizontal GvDatos.DataSource = dt Else Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia) - GvDatos.Columns.Clear() - dt = Nothing + GvDatos.DataSource = dt + GvDatos.DataBind() + UpDatos.Update() + Exit Sub End If Else ObjMovimientos.Dispose() Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError) + UpDatos.Update() Exit Sub End If GvDatos.DataBind() @@ -232,6 +238,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal Next + UpDatos.Update() End Sub Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound diff --git a/Inventarios/RepAlmacen.aspx b/Inventarios/RepAlmacen.aspx index b470d529a..06e760204 100644 --- a/Inventarios/RepAlmacen.aspx +++ b/Inventarios/RepAlmacen.aspx @@ -140,17 +140,35 @@
Tipo Almacen:
-
+
Aplica Almacen
-
+
- +
+ + + + + +
Grupo:
+
+ + + + +
+ + + + + +
@@ -159,11 +177,12 @@ - + - <%# Eval("Almacen") %> + <%--<%# Eval("Almacen") %>--%> diff --git a/Inventarios/RepAlmacen.aspx.vb b/Inventarios/RepAlmacen.aspx.vb index 8164a5732..ee1a1501b 100644 --- a/Inventarios/RepAlmacen.aspx.vb +++ b/Inventarios/RepAlmacen.aspx.vb @@ -54,7 +54,7 @@ Partial Class Inventarios_RepAlmacen Dim CveSubProyecto As Integer = DdlSucursal.SelectedValue.ToEntero() If objInv.GetRepAlmacenes(FechaI, FechaF, UsuarioActual.CveEmpresa, TipoAlmacen, DdlModalidadFiltro.SelectedValue.ToEntero, DdlAplicaInventario.SelectedValue.ToEntero, - Almacenes:=Almacenes, CveSubProyecto:=CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + Almacenes:=Almacenes, CveSubProyecto:=CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario, Gpo:=DdlGrupo.SelectedValue.ToEntero) Then GVAlmacen.DataSource = objInv.DtResultados TmpDT = objInv.DtResultados End If @@ -103,12 +103,28 @@ Partial Class Inventarios_RepAlmacen Protected Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click GenerarPDF() End Sub - Private Sub GVAlmacen_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVAlmacen.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.FCLabel("LtlAlmacen").Text = "" Then + Private Sub GVAlmacen_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVAlmacen.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + 'If e.Row.FCLabel("LtlAlmacen").Text = "" Then + ' e.Row.CssClass = "Totales" + 'End If + + If e.Row.Cells(0).Text = "" Then e.Row.CssClass = "Totales" End If + + If e.Row.DataKey("CveAlmacen").ToEntero > 0 Then + Dim Liga As String = $"./RepEntradasSalidas.aspx?CveAlmacen={e.Row.DataKey("CveAlmacen").ToEntero}&FechaInicio={1:d}&FechaCorte={2:d}&Tipo=-1" + e.Row.Cells(0).Text = $"{e.Row.DataKey("Gpo")}" + + <%# Eval("Almacen") %>- + End If + + End If + End Sub #End Region @@ -169,4 +185,6 @@ Partial Class Inventarios_RepAlmacen #End Region Public Overrides Sub VerifyRenderingInServerForm(control As Control) End Sub + + End Class diff --git a/Ventas/RepPedidosSTF.aspx b/Ventas/RepPedidosSTF.aspx index 32ac76c96..4ca4521a7 100644 --- a/Ventas/RepPedidosSTF.aspx +++ b/Ventas/RepPedidosSTF.aspx @@ -236,7 +236,8 @@
+ CssClass="table table-striped table-advance table-hover Widthall ScrollAD" DataKeyNames="CveCliente,CveVendedor,CveSubProyecto,CvePS,CveUnidadMedida,Cantidad,PU,CveVentaDetalle,GastosEnvio,CveVenta,SerieFolio" data-sort="true" GridLines="None" Width="99%" + OnRowDataBound="GvE_RowDataBound"> diff --git a/Ventas/RepPedidosSTF.aspx.vb b/Ventas/RepPedidosSTF.aspx.vb index d645f16d0..06e929e9f 100644 --- a/Ventas/RepPedidosSTF.aspx.vb +++ b/Ventas/RepPedidosSTF.aspx.vb @@ -150,6 +150,11 @@ Partial Class Ventas_RepPedidosSTF If e.Row.DBCampo("TipoRenglon") = "1" Then e.Row.CssClass = "SubTotales" + If UsuarioActual.TienePermisoPagina(6) Then + e.Row.Cells(1).Text = $"{e.Row.DataKey("SerieFolio")}" + End If + + End If If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then @@ -444,4 +449,16 @@ Partial Class Ventas_RepPedidosSTF UpBodyHorariosPedidos.Update() RegistraScript("$('#divHorariosPedidos').modal({ backdrop: 'static', keyboard: false});") End Sub + + Protected Sub GvE_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.DataRow Then + If UsuarioActual.TienePermisoPagina(6) Then + e.Row.Cells(1).Text = $"{e.Row.DataKey("SerieFolio")}" + End If + End If + + + + End Sub End Class