Puntos GDiaz:

--Resumen de movimientos de inventario. (corte almacen)
This commit is contained in:
2024-09-10 16:18:10 -07:00
parent 2c56c04d1f
commit ac6cbc1496
4 changed files with 291 additions and 0 deletions

View File

@@ -1540,6 +1540,22 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetRepResumenMovimientosDiario(Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Inv_RepResumenMovimientosDiarioGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el reporte de metas por vendedores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return retorno
End Function
Public Function GetKardexAlmacen(CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -10424,6 +10424,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Inventarios/RepEntregaAlmacenRuta.aspx".ToUpper(), 1319)
PaginaDict.Add("/Inventarios/CartaPorteManual.aspx".ToUpper(), 1321)
PaginaDict.Add("/Inventarios/EntradasSalidas.aspx?AL=1".ToUpper(), 1334)
PaginaDict.Add("/Inventarios/RepResumenMovimientosDiario.aspx".ToUpper(), 896)
#End Region
#Region "MF"
PaginaDict.Add("/MF/BitacoraDiaria.aspx".ToUpper(), 801)

View File

@@ -0,0 +1,211 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepResumenMovimientosDiario.aspx.vb" Inherits="Inventarios_RepResumenMovimientosDiario" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scrollFoot {
display: none;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.table table-striped table-hover dataTable no-footer {
margin-top: 0px !important;
}
.Excede {
overflow: hidden;
text-overflow: ellipsis;
}
.psagregar > div.comboxes {
display: inline-block;
width: 250px;
}
.psagregar > div.codigo input {
width: 79px;
}
.psagregar > div.codigo {
display: inline-block;
width: 80px;
}
.psagregar > div.codigo > input[type="submit"] {
display: none;
}
.widget-thumb {
padding: 15px;
border-radius: 4px;
}
.widget-thumb.bordered {
border: 3px solid whitesmoke;
}
.widget-thumb .widget-thumb-heading {
font-size: 14px;
font-weight: 700;
color: #8e9daa;
margin: 0px 5px;
text-align: center;
}
.widget-thumb .widget-thumb-wrap {
overflow: hidden;
}
.widget-thumb .widget-thumb-wrap .widget-thumb-icon {
float: left;
width: 60px;
height: 60px;
display: inline-block;
font-size: 20px;
line-height: 41px;
color: #fff;
text-align: center;
padding: 10px;
margin-right: 15px;
}
.widget-thumb .widget-thumb-body {
overflow: hidden;
padding: 5px;
}
.widget-thumb .widget-thumb-body .widget-thumb-subtitle {
padding-top: 2px;
display: block;
font-size: 14px;
font-weight: 600;
color: #8e9daa;
}
.widget-thumb .widget-thumb-body .widget-thumb-body-stat {
display: block;
font-size: 20px;
font-weight: 600;
color: #3e4f5e;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Resumen de movimientos del cierre del dia
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkImprimir" runat="server" OnClick="LnkImprimir_Click"><i class="fa fa-file-pdf-o" style="font-weight: bold;"></i>Exportar a PDF</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkImprimir" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltros">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 45px; position: relative;">
<div class="tools">
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" /></td>
</div>
<div class="titlefiltros caption magindate">
<div class="row">
<div class="col-md-1 truncate text-right">Fecha del mes: </div>
<div class="col-md-3">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaMes" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaMes" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaMes" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaMes" PopupButtonID="ImgFechaMes" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="text-right" style="margin: 5px 0px;">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:GridView ID="GvDatos" Width="100%" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="False" AllowPaging="False"
ShowFooter="True" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None" DataKeyNames="CveMovimiento,FechaMovto">
<Columns>
<asp:BoundField DataField="FechaMovto" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" ItemStyle-Width="90px" HeaderText="Fecha" />
<asp:BoundField DataField="Almacen" HeaderText="Almacén" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Concepto" HeaderText="Movimiento" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="TipoMovimiento" HeaderText="Tipo" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Folio">
<ItemTemplate>
<asp:HyperLink ID="hlFolio" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" NavigateUrl='<%# Eval("CveMovimiento", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}")%>' Target="_blank" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Right" HeaderText="Entrada">
<ItemTemplate>
<asp:Label ID="lbEntrada" runat="server"
Text='<%# Eval("Entrada", "{0:###,###.####}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Right" HeaderText="Salida">
<ItemTemplate>
<asp:Label ID="lbSalida" runat="server"
Text='<%# Eval("Salida", "{0:###,###.####}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ClienteProveedor" HeaderText="Cliente/Proveedor" ItemStyle-HorizontalAlign="Left" />
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btConsultar" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,63 @@
Option Strict On
Option Explicit On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Inventarios_RepResumenMovimientosDiario
Inherits ClsPaginas
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
TxtFechaMes.Text = NowADS().ToString("dd/MM/yyyy")
End If
End Sub
Private Sub CargarDatos()
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetRepResumenMovimientosDiario(TxtFechaMes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
DtDatos = ObjInventarios.DtResultados.Copy()
GvDatos.DataSource = DtDatos
End If
ObjInventarios.Dispose()
GvDatos.DataBind()
End Sub
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
CargarDatos()
UPDatos.Update()
End Sub
Private Sub GenerarPDF(Optional Formato As String = "PDF")
If GvDatos.Rows.Count > 0 Then
If DtDatos IsNot Nothing Then
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Fecha", TxtFechaMes.Text))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
ImprimirPDF("Empresas/Grales/Formatos/RepResumenMovimientosDiario.rdlc", DtDatos, params, "Reporte Diario", Formato)
End If
Else
Alert("No hay informacion cargada", TipoMensaje.MsgAdvertencia)
End If
End Sub
Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs)
GenerarPDF("PDF")
End Sub
End Class