From a39fceabc0715e59b35e1378723c1d2379d04e59 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Wed, 2 Oct 2019 13:57:12 -0700 Subject: [PATCH] =?UTF-8?q?Se=20cre=C3=B3=20Rep=20Traspaso=20Almacen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 34 +- .../Grales/Formatos/RepTraspasoAlmacen.rdlc | 684 +++--------------- Inventarios/RepTraspasoAlmacen.aspx | 98 +-- Inventarios/RepTraspasoAlmacen.aspx.vb | 133 ++-- 4 files changed, 198 insertions(+), 751 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index af57333b1..a0ca323b8 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1700,10 +1700,32 @@ Public Class ClsInventarios End Try Return Retorno - End Function + End Function + + Public Function RepTraspasoAlmacen(FechaI As String, FechaF As String, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RepTraspasoAlmacen") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.VarChar).Value = FechaI + .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen + .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino + .Add("@Recibido", SqlDbType.Bit).Value = Recibido + .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 Traspaso de Almacén.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #End Region - + #Region " INVENTARIOS - EXISTENCIAS " Public Function GetExistenciasPS(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, @@ -1889,8 +1911,8 @@ Public Class ClsInventarios Catch ex As Exception OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try - Return Retorno + End Function Public Function GetExistenciasPSEmpaque(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, @@ -1965,11 +1987,11 @@ Public Class ClsInventarios End Try Return Retorno - End Function + End Function #End Region - + #Region " INVENTARIOS - INVENTARIO FISICO " - + Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc index 0436f0766..a76bee9e1 100644 --- a/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc +++ b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc @@ -6,34 +6,19 @@ - 2.08796cm + 3.57404cm - 1.91126cm + 2.36927cm 2.15604cm - 8.12274cm + 15.6445cm - 1.75917cm - - - 2.01115cm - - - 2.20458cm - - - 2.12958cm - - - 2.11575cm - - - 1.23cm + 2.02375cm @@ -49,7 +34,7 @@ - Folio + Disponible @@ -104,7 +89,7 @@ - Fecha + Unidad @@ -159,7 +144,7 @@ - F. Venc. + Código @@ -214,7 +199,7 @@ - Cliente + Producto @@ -269,7 +254,7 @@ - Contrato + SerieLote @@ -315,281 +300,6 @@ - - - - true - true - - - - - Facturado - - - - - - - Textbox13 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - SubTotal - - - - - - - Textbox15 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - IVA - - - - - - - Textbox17 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Total - - - - - - - Textbox19 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - Textbox6 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - @@ -597,28 +307,31 @@ - + true true - =Fields!Folio.Value + =IIf(Fields!PS.Value = "", "Folio: " & Fields!FolioSalida.Value, Fields!Cantidad.Value) - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") 2pt 2pt 2pt @@ -629,17 +342,19 @@ - + true true - =Fields!Fecha.Value + =IIf(Fields!PS.Value = "", Fields!FechaMovto.Value, Fields!UnidadMedida.Value) @@ -648,12 +363,12 @@ - Fecha + UnidadMedida - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") 2pt 2pt 2pt @@ -664,16 +379,17 @@ - + true true - =Fields!FechaVencimiento.Value + =Fields!Codigo.Value @@ -682,12 +398,12 @@ - FechaVencimiento + Codigo - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") 2pt 2pt 2pt @@ -698,240 +414,29 @@ - + true - =Fields!Cliente.Value + =IIf(Fields!PS.Value = "", "Almacén Destino: " & Fields!AlmacenDestino.Value & " Responsable: " & Fields!Recibio.Value, Fields!PS.Value) - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!TieneContrato.Value - - - - - - - TieneContrato - - - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorcentajeAvance.Value - - - - % - - - - - - - PorcentajeAvance - - - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SubTotal.Value - - - - - - - SubTotal - - - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!IVA.Value - - - - - - - IVA - - - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total - - - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Abreviatura.Value - - - - - - - Abreviatura - - - =IIf(Fields!CveVenta.Value = "", "#9cacc1", "Transparent") + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") 2pt 2pt 2pt @@ -941,6 +446,41 @@ true + + + + true + true + + + + + =Fields!SerieLote.Value + + + + + + + SerieLote + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + @@ -952,11 +492,6 @@ - - - - - @@ -977,7 +512,7 @@ 0.17639cm 0.24474cm 0.90897cm - 25.72823cm + 25.7676cm @@ -991,7 +526,7 @@ 10.24108in - 3.18974cm + 3.48078cm true true @@ -1014,7 +549,7 @@ Textbox1 - 0.18521cm + 0.47625cm 6.54965cm 0.6cm 12.60299cm @@ -1035,7 +570,7 @@ - REPORTE DE REMISIONES PENDIENTES POR FACTURAR + REPORTE DE TRASPASO DE ALMACÉN - 3.01335cm + 3.30439cm 0.24474cm 0cm 25.72823cm @@ -1338,7 +874,7 @@ - IMPRESO EN SIG, Rep. Remisiones + IMPRESO EN SIG, Rep. Traspaso Almacén @@ -1398,52 +934,40 @@ /* Local Query */ - - Folio + + Cantidad + System.Double + + + UnidadMedida System.String - - Fecha + + Codigo System.String - - Cliente + + PS System.String - - TieneContrato + + SerieLote System.String - - SeTimbro + + FolioSalida System.String - - SubTotal + + FechaMovto System.String - - IVA + + AlmacenDestino System.String - - Total - System.String - - - FechaVencimiento - System.String - - - PorcentajeAvance - System.String - - - Abreviatura - System.String - - - CveVenta + + Recibio System.String @@ -1488,12 +1012,6 @@ true ReportParameter1 - - String - true - true - ReportParameter1 - String true diff --git a/Inventarios/RepTraspasoAlmacen.aspx b/Inventarios/RepTraspasoAlmacen.aspx index e68c709bb..7a960e4a4 100644 --- a/Inventarios/RepTraspasoAlmacen.aspx +++ b/Inventarios/RepTraspasoAlmacen.aspx @@ -83,12 +83,12 @@ - <%--
  • +
  • PDF
  • Excel -
  • --%> +
    @@ -163,12 +163,15 @@
    >
    + +
    + +
    - -
    - -
    - + +
    + +
    @@ -183,85 +186,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - <%-- - - - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - - <%----%> - - + + + + + diff --git a/Inventarios/RepTraspasoAlmacen.aspx.vb b/Inventarios/RepTraspasoAlmacen.aspx.vb index 5136b56dd..b946ac833 100644 --- a/Inventarios/RepTraspasoAlmacen.aspx.vb +++ b/Inventarios/RepTraspasoAlmacen.aspx.vb @@ -41,12 +41,12 @@ Partial Class RepTraspasoAlmacen ' ViewState("Sucursales") = value ' End Set 'End Property - Private Property DtVentas As DataTable + Private Property DtInventarios As DataTable Get - Return DirectCast(ViewState("DtVentas"), DataTable) + Return DirectCast(ViewState("DtInventarios"), DataTable) End Get Set(value As DataTable) - ViewState("DtVentas") = value + ViewState("DtInventarios") = value End Set End Property @@ -66,7 +66,7 @@ Partial Class RepTraspasoAlmacen #Region " C A R G A - D A T O S " Public Sub CargaDatos() - Dim ObjVentas As New ClsVentas + Dim ObjInventarios As New ClsInventarios FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") @@ -74,14 +74,14 @@ Partial Class RepTraspasoAlmacen 'Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString - If ObjVentas.GetRepRemisionesNCSinFacturar(FechaI, FechaF, "-1", -1, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - GvDatos.DataSource = ObjVentas.DtResultados - DtVentas = ObjVentas.DtResultados + If ObjInventarios.RepTraspasoAlmacen(FechaI, FechaF, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, ChkRecibido.Checked, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjInventarios.DtResultados + DtInventarios = ObjInventarios.DtResultados GvDatos.DataBind() UPDatos.Update() End If - ObjVentas.Dispose() + ObjInventarios.Dispose() End Sub #End Region @@ -99,21 +99,13 @@ Partial Class RepTraspasoAlmacen Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CveCliente") = "" Then + 'Cuando es titulo + If e.Row.DBCampo("PS").ToString.Trim = "" Then e.Row.CssClass = "Totales" - ElseIf e.Row.DBCampo("CveVenta") = "" Then - e.Row.CssClass = "SubTotales2" - e.Row.Font.Bold = True - e.Row.Attributes.Add("style", "background:#CCCCCC !important") - Else - e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & "" - If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then - ' e.Row.Cells(2).CssClass = "danger" - e.Row.Cells(2).ForeColor = Drawing.Color.Red - End If - - 'e.Row.Cells(5).Text = e.Row.Cells(5).Text + "%" + e.Row.Cells(0).Text = String.Format("Folio: {0} ", e.Row.DBCampo("FolioSalida"), e.Row.DBCampo("CveMovimientoSalida")) + e.Row.Cells(1).Text = String.Format("{0}", e.Row.DBCampo("FechaMovto").ToString.ToDate.ToShortDateString) + e.Row.Cells(3).Text = String.Format("Almacen Destino: {0}       Responsable: {1}", e.Row.DBCampo("AlmacenDestino"), e.Row.DBCampo("Recibio")) End If End If @@ -122,82 +114,63 @@ Partial Class RepTraspasoAlmacen #Region "CARGA COMBOS FILTRO" Private Sub CargaAlmacenOrigen() - DdlAlmacenOrigen.Enabled = True - DdlAlmacenOrigen.Items.Clear() DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)") - DdlAlmacenOrigen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) + DdlAlmacenOrigen.Items.Insert(0, New ListItem(" Todos ", "-1")) DdlAlmacenOrigen.SelectedValue = "-1" DdlAlmacenOrigen.DataBind() DdlAlmacenOrigen.SelectedValueExist(UsuarioActual.CveAlmacen) End Sub Private Sub CargaAlmacenDestino() - DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11) AND Estatus = 'Activo'") - 'DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen <> 4") + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)") DdlAlmacenDestino.DataBind() - DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlAlmacenDestino.Items.Insert(0, New ListItem("Todos", "-1")) + DdlAlmacenDestino.SelectedValue = "-1" End Sub - 'Private Sub CargaCliente() - ' 'CargaClientes - ' Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) - ' If EsWS Then - ' DdlClientes.setEsWebService(True) - ' Else - ' DdlClientes.setEsWebService(False) - ' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) - ' DdlClientes.DataBind() - ' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) - ' End If - - 'End Sub - 'Private Sub CargaSucursales() - - ' DdlSubProyectos.DataSource() = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - ' DdlSubProyectos.DataBind() - ' 'DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) - 'End Sub #End Region -#Region "PDF" - 'Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click - ' If DtVentas IsNot Nothing Then - ' Dim StrFiltro As New StringBuilder - ' If DdlSubProyectos.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Sucursal: {0}", DdlSubProyectos.GetSelectedText) - ' If DdlClientes.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Cliente: {0}", DdlClientes.SelectedText) - ' 'If DdlContrato.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Contrato: {0}", DdlContrato.SelectedItem.Text) +#Region "IMPRESION" + Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click + Imprime("PDF") + End Sub + Private Sub Imprime(Formato As String) + If DtInventarios IsNot Nothing Then + Dim StrFiltro As New StringBuilder + If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio: {0}", txtFechaI.Text.ToDate.ToShortDateString) + If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin: {0}", txtFechaF.Text.ToDate.ToShortDateString) - ' If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", txtFechaI.Text.ToDate.ToShortDateString) - ' If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", txtFechaF.Text.ToDate.ToShortDateString) + If DdlAlmacenOrigen.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Origen: {0}", DdlAlmacenOrigen.SelectedItem.Text) + If DdlAlmacenDestino.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Destino: {0}", DdlAlmacenDestino.SelectedItem.Text) + If ChkRecibido.Checked Then StrFiltro.AppendFormat(" Recibidos: Si") Else StrFiltro.AppendFormat(" Recibidos: No") - ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - ' Dim FechaI, FechaF As String - ' FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) - ' FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) + Dim FechaI, FechaF As String + FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) + FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) - ' Dim params As New List(Of ReportParameter) - ' params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) - ' params.Add(New ReportParameter("FechaInicio", FechaI)) - ' params.Add(New ReportParameter("FechaFin", FechaF)) - ' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - ' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) - ' params.Add(New ReportParameter("Filtros", StrFiltro.ToString)) - ' If Imagen.Exists Then - ' params.Add(New ReportParameter("LogoPath", logouri)) - ' Else - ' params.Add(New ReportParameter("LogoPath", "")) - ' End If - ' ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", Now.ToDateTime.ToShortDateString)) - ' Else - ' Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) - ' End If - 'End Sub + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("FechaInicio", FechaI)) + params.Add(New ReportParameter("FechaFin", FechaF)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("Filtros", StrFiltro.ToString)) + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + ImprimirPDF("Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc", DtInventarios, params, String.Format("RepTraspasoAlmacen-{0}", Now.ToDateTime.ToShortDateString), Formato) + Else + Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) + End If + End Sub #End Region Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click CargaDatos() End Sub - 'Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click - ' GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & Now.ToShortDateString) - 'End Sub + Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + Imprime("Excel") + End Sub End Class