Reporte de Pedidos liga a venta si tiene permiso, RepAlmacen obs grupo medico, KArdex Almacen horizontal fix segunda consulta

This commit is contained in:
rakcsle
2025-03-14 11:56:03 -07:00
parent 2dc1be0bb6
commit a40c5b9cb9
7 changed files with 77 additions and 14 deletions

View File

@@ -325,7 +325,7 @@ Public Class ClsInventarios
End Function End Function
Public Function GetRepAlmacenes(FechaInicio As String, FechaFin As String, CveEmpresa As Integer, CveTipoAlmacen As String, Contabilizable As Integer, Inventariable As Integer, 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 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 Dim Retorno As Boolean = False
DataAdapter("PA_Inv_AlmacenesRepGet") DataAdapter("PA_Inv_AlmacenesRepGet")
@@ -340,6 +340,7 @@ Public Class ClsInventarios
.Add("@Almacenes", SqlDbType.VarChar).Value = Almacenes .Add("@Almacenes", SqlDbType.VarChar).Value = Almacenes
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@Gpo", SqlDbType.Int).Value = Gpo
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -348,7 +348,7 @@ table.adssigscroll {
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:UpdatePanel ID="UpDatos" runat="server"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="divContainerads"> <div class="divContainerads">

View File

@@ -161,6 +161,9 @@ Partial Class Inventarios_KardexAlmacenHorizontal
End Sub End Sub
Private Sub CargarKardex(CvePS As Integer) Private Sub CargarKardex(CvePS As Integer)
'GvDatos.Columns.Clear()
'GvDatos.AutoGenerateColumns = True
Dim dt As New DataTable Dim dt As New DataTable
Dim ObjMovimientos As New ClsInventarios Dim ObjMovimientos As New ClsInventarios
Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1") 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 GvDatos.DataSource = dt
Else Else
Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia) Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia)
GvDatos.Columns.Clear() GvDatos.DataSource = dt
dt = Nothing GvDatos.DataBind()
UpDatos.Update()
Exit Sub Exit Sub
End If End If
Else Else
ObjMovimientos.Dispose() ObjMovimientos.Dispose()
Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError) Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError)
UpDatos.Update()
Exit Sub Exit Sub
End If End If
GvDatos.DataBind() GvDatos.DataBind()
@@ -232,6 +238,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
Next Next
UpDatos.Update()
End Sub End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound

View File

@@ -140,17 +140,35 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate v-center" style="text-align: right!important">Tipo Almacen:</div> <div class="col-md-1 truncate v-center" style="text-align: right!important">Tipo Almacen:</div>
<div class="col-md-2 v-center"> <div class="col-md-1 v-center">
<asp:ListBox ID="DdlTipoAlmacen" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Style="width: 100%;" runat="server"></asp:ListBox> <asp:ListBox ID="DdlTipoAlmacen" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Style="width: 100%;" runat="server"></asp:ListBox>
</div> </div>
<div class="col-md-1 truncate" style="text-align: right!important">Aplica Almacen</div> <div class="col-md-1 truncate" style="text-align: right!important">Aplica Almacen</div>
<div class="col-md-2"> <div class="col-md-1">
<asp:DropDownList ID="DdlAplicaInventario" runat="server" CssClass="input-small input-sm select2me" Width="100%"> <asp:DropDownList ID="DdlAplicaInventario" runat="server" CssClass="input-small input-sm select2me" Width="100%">
<asp:ListItem Text="Todos" Value="-1" Selected="True"> </asp:ListItem> <asp:ListItem Text="Todos" Value="-1" Selected="True"> </asp:ListItem>
<asp:ListItem Text="Inventariable" Value="1"></asp:ListItem> <asp:ListItem Text="Inventariable" Value="1"></asp:ListItem>
<asp:ListItem Text="No Inventariable" Value="0"></asp:ListItem> <asp:ListItem Text="No Inventariable" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate" style="text-align: right!important">Grupo:</div>
<div class="col-md-1">
<asp:DropDownList ID="DdlGrupo" runat="server" CssClass="input-small input-sm select2me" Width="100%">
<asp:ListItem Text="Almacen" Value="1"></asp:ListItem>
<asp:ListItem Text="Clasificación" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -159,11 +177,12 @@
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GVAlmacen" runat="server" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None"> <asp:GridView ID="GVAlmacen" runat="server" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None"
DataKeyNames="Gpo,CveAlmacen,CveClasificacion" >
<Columns> <Columns>
<asp:TemplateField HeaderText="Almacén"> <asp:TemplateField HeaderText="Almacén">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HyperLink1" Target="_blank" NavigateUrl='<%# String.Format("/Inventarios/RepEntradasSalidas.aspx?CveAlmacen={0}&FechaInicio={1:d}&FechaCorte={2:d}&Tipo=-1", Eval("CveAlmacen").ToString, Eval("FechaInicio"), Eval("FechaFin"))%>' runat="server"><%# Eval("Almacen") %></asp:HyperLink> <%--<asp:HyperLink ID="HyperLink1" Target="_blank" NavigateUrl='<%# String.Format("/Inventarios/RepEntradasSalidas.aspx?CveAlmacen={0}&FechaInicio={1:d}&FechaCorte={2:d}&Tipo=-1", Eval("CveAlmacen").ToString, Eval("FechaInicio"), Eval("FechaFin"))%>' runat="server"><%# Eval("Almacen") %></asp:HyperLink>--%>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Almacén"> <asp:TemplateField HeaderText="Tipo Almacén">

View File

@@ -54,7 +54,7 @@ Partial Class Inventarios_RepAlmacen
Dim CveSubProyecto As Integer = DdlSucursal.SelectedValue.ToEntero() Dim CveSubProyecto As Integer = DdlSucursal.SelectedValue.ToEntero()
If objInv.GetRepAlmacenes(FechaI, FechaF, UsuarioActual.CveEmpresa, TipoAlmacen, DdlModalidadFiltro.SelectedValue.ToEntero, DdlAplicaInventario.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 GVAlmacen.DataSource = objInv.DtResultados
TmpDT = objInv.DtResultados TmpDT = objInv.DtResultados
End If End If
@@ -104,11 +104,27 @@ Partial Class Inventarios_RepAlmacen
GenerarPDF() GenerarPDF()
End Sub End Sub
Private Sub GVAlmacen_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVAlmacen.RowDataBound Private Sub GVAlmacen_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVAlmacen.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.FCLabel("LtlAlmacen").Text = "" 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" e.Row.CssClass = "Totales"
End If 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 = $"<a href='{Liga}' target='_blank' >{e.Row.DataKey("Gpo")}</a>"
<asp:HyperLink ID = "HyperLink1" Target="_blank" NavigateUrl='<%# String.Format("/Inventarios/RepEntradasSalidas.aspx?CveAlmacen={0}&FechaInicio={1:d}&FechaCorte={2:d}&Tipo=-1", Eval("CveAlmacen").ToString, Eval("FechaInicio"), Eval("FechaFin"))%>' runat="server"><%# Eval("Almacen") %></asp:HyperLink>-
End If
End If End If
End Sub End Sub
#End Region #End Region
@@ -169,4 +185,6 @@ Partial Class Inventarios_RepAlmacen
#End Region #End Region
Public Overrides Sub VerifyRenderingInServerForm(control As Control) Public Overrides Sub VerifyRenderingInServerForm(control As Control)
End Sub End Sub
End Class End Class

View File

@@ -236,7 +236,8 @@
<ContentTemplate> <ContentTemplate>
<div style="min-height: 250px; overflow-x: scroll"> <div style="min-height: 250px; overflow-x: scroll">
<asp:GridView ID="GvE" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados" <asp:GridView ID="GvE" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" DataKeyNames="CveCliente,CveVendedor,CveSubProyecto,CvePS,CveUnidadMedida,Cantidad,PU,CveVentaDetalle,GastosEnvio" data-sort="true" GridLines="None" Width="99%"> 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">
<Columns> <Columns>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" ItemStyle-Width="30%" /> <asp:BoundField HeaderText="Cliente" DataField="NombreComercial" ItemStyle-Width="30%" />
<asp:BoundField HeaderText="SerieFolio" DataField="SerieFolio" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="SerieFolio" DataField="SerieFolio" ItemStyle-Width="10%" />

View File

@@ -150,6 +150,11 @@ Partial Class Ventas_RepPedidosSTF
If e.Row.DBCampo("TipoRenglon") = "1" Then e.Row.CssClass = "SubTotales" If e.Row.DBCampo("TipoRenglon") = "1" Then e.Row.CssClass = "SubTotales"
If UsuarioActual.TienePermisoPagina(6) Then
e.Row.Cells(1).Text = $"<a href='./Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}' target='_blank' class ='Texto' >{e.Row.DataKey("SerieFolio")}</a>"
End If
End If End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
@@ -444,4 +449,16 @@ Partial Class Ventas_RepPedidosSTF
UpBodyHorariosPedidos.Update() UpBodyHorariosPedidos.Update()
RegistraScript("$('#divHorariosPedidos').modal({ backdrop: 'static', keyboard: false});") RegistraScript("$('#divHorariosPedidos').modal({ backdrop: 'static', keyboard: false});")
End Sub 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 = $"<a href='./Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}' target='_blank' class ='Texto' >{e.Row.DataKey("SerieFolio")}</a>"
End If
End If
End Sub
End Class End Class