From cf047d7412b9399fae707089420e2143c8783cd9 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 29 May 2020 15:30:08 -0700 Subject: [PATCH 01/55] ajuste Serie lote caducidad --- App_Code/ClsInventarios.vb | 36 +++++++++++++++--------------- Inventarios/EntregaAlmacen.aspx.vb | 26 +++++++++++++++++---- Ventas/Ventas.aspx.vb | 4 ++++ 3 files changed, 44 insertions(+), 22 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index b9cc28b9d..6f2ebaad9 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2904,28 +2904,28 @@ Public Class ClsInventarios Return Retorno End Function - Public Function LoteBatchFechaCaducidadGet(CvePS As Integer, Lote As String, Batch As String, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean - Dim Retorno As Boolean = False + 'Public Function LoteBatchFechaCaducidadGet(CvePS As Integer, Lote As String, Batch As String, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean + ' Dim Retorno As Boolean = False - DataAdapter("PA_Inv_LoteBatchFechaCaducidadGet") + ' DataAdapter("PA_Inv_LoteBatchFechaCaducidadGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Lote", SqlDbType.VarChar).Value = Lote - .Add("@Batch", SqlDbType.VarChar).Value = Batch - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CvePS", SqlDbType.Int).Value = CvePS + ' .Add("@Lote", SqlDbType.VarChar).Value = Lote + ' .Add("@Batch", SqlDbType.VarChar).Value = Batch + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + ' End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la Fecha Caducidad del Lote-Batch.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener la Fecha Caducidad del Lote-Batch.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function Public Function ActualizarEsDevolucionVenta(CveVenta As Integer, Valor As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("Vta_UpdateDevolucionVenta") diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 4777d29aa..87b0ad449 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -596,7 +596,9 @@ Partial Class Inventarios_EntregaAlmacen DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen) End If - + If Not DtDatos.Columns.Contains("Serie") Then + DtDatos.Columns.Add("Serie", GetType(String)) + End If If Not DtDatos.Columns.Contains("Lote") Then DtDatos.Columns.Add("Lote", GetType(String)) End If @@ -744,6 +746,20 @@ Partial Class Inventarios_EntregaAlmacen DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen) End If + If Not DtDatos.Columns.Contains("CveSeccion") Then + DtDatos.Columns.Add("CveSeccion", GetType(Integer)) + End If + + If Not DtDatos.Columns.Contains("FechaCaducidad") Then + DtDatos.Columns.Add("FechaCaducidad", GetType(Date)) + End If + If Not DtDatos.Columns.Contains("Seleccionado") Then + DtDatos.Columns.Add("Seleccionado", GetType(Boolean)) + End If + If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then + DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double)) + End If + If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then DivCodigoSeriePS.Visible = True Else @@ -812,7 +828,8 @@ Partial Class Inventarios_EntregaAlmacen If e.Row.DBCampo("Consec") <> "" AndAlso DtDatosDetalle IsNot Nothing Then Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString - 'e.Row.FCTextBox("TbCantidadF").Text = "0" + Else + e.Row.FCTextBox("TbCantidadF").Text = "0" End If @@ -867,6 +884,7 @@ Partial Class Inventarios_EntregaAlmacen 'FUNCIONALIDAD PISTOLA DE CODIGOS If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then + e.Row.FCTextBox("TbCantidadF").Text = "0" 'NO BLOQUEA PARA ROL AD If UsuarioActual.CveRol = 1 Then If e.Row.DBCampo("Inv_CveMetodoInventario").Contiene("5", "6") Then @@ -2540,10 +2558,10 @@ Partial Class Inventarios_EntregaAlmacen If CBool(Dr("AplicaSerie")) Then DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) For Each Dr1 As DataRow In DtDetalle.Rows - StrXML.AppendFormat("", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("YYYY/MM/DD")) + StrXML.AppendFormat("", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd")) Next Else - StrXML.AppendFormat("", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("YYYY/MM/DD")) + StrXML.AppendFormat("", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd")) End If End If Next diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 212a0069d..f59b0d4b3 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -18371,6 +18371,10 @@ Partial Class Ventas DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime")) End If + If Not DtTemporal.Columns.Contains("Serie") Then + DtTemporal.Columns.Add("Serie", Type.GetType("System.String")) + End If + GvInv.Columns(4).Visible = DtTemporal.MAX("Serie", "Serie <> ''") <> "" Or CveVenta <= 0 GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> "" GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad").ToDate > MinFecha From 58ab0499d01a63c2200ce39dfed164b5848beb60 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 29 May 2020 19:57:48 -0700 Subject: [PATCH 02/55] =?UTF-8?q?validaci=C3=B3n=20de=20campos=20en=20los?= =?UTF-8?q?=20pop=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/PopUpBuscarIE.aspx.vb | 39 ++++--- CGame/PopUpBuscarEmpaque.aspx.cs | 45 +++++--- CGame/PopUpBuscarOrdenProduccion.aspx.vb | 35 ++++-- CRM/PopUpBuscarAcercamiento.aspx.cs | 42 +++++-- Compras/PopUpBuscarProveedor.aspx.vb | 34 ++++-- Contratos/PopUpBuscarContrato.aspx.vb | 46 +++++--- Inventarios/PopUpBuscarMovto.aspx.vb | 43 ++++--- Inventarios/PopUpExistenciasAlmacen.aspx.vb | 121 +++++++++++--------- OC/PopUpBuscarReq.aspx.vb | 37 ++++-- OS/PopUpBuscarOS.aspx.vb | 30 +++-- RH/PopUpBuscarPersonal.aspx.vb | 10 ++ Ventas/PopUpBuscarPs.aspx.vb | 6 + 12 files changed, 325 insertions(+), 163 deletions(-) diff --git a/Bancos/PopUpBuscarIE.aspx.vb b/Bancos/PopUpBuscarIE.aspx.vb index 494a38e23..28e66b31b 100644 --- a/Bancos/PopUpBuscarIE.aspx.vb +++ b/Bancos/PopUpBuscarIE.aspx.vb @@ -67,23 +67,29 @@ Partial Class Bancos_PopUpBuscarIE Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjBancosIE As New ClsBancos Dim Folio As String = "-1" If TxtFolio.Text <> "" Then Folio = String.Format("%{0}%", TxtFolio.Text.Trim) - If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate, MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then - DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados) + If ValidarFiltrosSeleccionado() Then + + Dim ObjBancosIE As New ClsBancos + If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate, + MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then + DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados) + Else + Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError) + DtDatos = Nothing + End If + + ObjBancosIE.Dispose() + + If DtDatos IsNot Nothing Then + GvDatos.DataSource = DtDatos + GvDatos.DataBind() + UpDatos.Update() + End If Else - Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError) - DtDatos = Nothing - End If - - ObjBancosIE.Dispose() - - If DtDatos IsNot Nothing Then - GvDatos.DataSource = DtDatos - GvDatos.DataBind() - UpDatos.Update() + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If End Sub @@ -103,4 +109,11 @@ Partial Class Bancos_PopUpBuscarIE End If End Sub + Private Function ValidarFiltrosSeleccionado() As Boolean + If DdlBanco.SelectedValue.ToEntero > 0 Then Return True + If DdlCuenta.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.Length > 0 Then Return True + Return False + End Function + End Class diff --git a/CGame/PopUpBuscarEmpaque.aspx.cs b/CGame/PopUpBuscarEmpaque.aspx.cs index 72d8e2765..ce4a09ed2 100644 --- a/CGame/PopUpBuscarEmpaque.aspx.cs +++ b/CGame/PopUpBuscarEmpaque.aspx.cs @@ -26,27 +26,32 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas } protected void Consultar_Click(object sender, EventArgs e) { - String Folio; - if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; } - ClsCGame ObjCGame = new ClsCGame(); - if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), TxtFechaEntregaI.Text.ToDate(), TxtFechaEntregaF.Text.ToDate())) + if (ValidarFiltrosSeleccionados()) { - GvDatos.DataSource = ObjCGame.DtResultados; - GvDatos.DataBind(); - LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString(); - if (ObjCGame.DtResultados.Rows.Count < 1) + String Folio; + if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; } + ClsCGame ObjCGame = new ClsCGame(); + if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), TxtFechaEntregaI.Text.ToDate(), TxtFechaEntregaF.Text.ToDate())) { - Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia); - } - else - { - TblBusqueda.Visible = true; + GvDatos.DataSource = ObjCGame.DtResultados; + GvDatos.DataBind(); + LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString(); + if (ObjCGame.DtResultados.Rows.Count < 1) + { + Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia); + } + else + { + TblBusqueda.Visible = true; + } } + ObjCGame.Dispose(); + UPDatos.Update(); + }else + { + Alert("Seleccione un criterio de busqueda",TipoMensaje.MsgAdvertencia); } - ObjCGame.Dispose(); - UPDatos.Update(); - } #region GridView @@ -60,4 +65,12 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas } #endregion + private bool ValidarFiltrosSeleccionados() + { + if(TxtFolio.Text.Length > 0) return true; + if(DdlHuerta.SelectedValue.ToEntero() > 0) return true; + if(TxtFechaEntregaI.Text.Length > 0) return true; + if(TxtFechaEntregaF.Text.Length > 0) return true; + return false; + } } \ No newline at end of file diff --git a/CGame/PopUpBuscarOrdenProduccion.aspx.vb b/CGame/PopUpBuscarOrdenProduccion.aspx.vb index 484e1a0fa..f2bc848fc 100644 --- a/CGame/PopUpBuscarOrdenProduccion.aspx.vb +++ b/CGame/PopUpBuscarOrdenProduccion.aspx.vb @@ -37,19 +37,23 @@ Partial Class CGame_PopUpBuscarOrdenProduccion Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click Dim Folio As String If TxtFolio.Text.Trim <> "" Then Folio = TxtFolio.Text Else Folio = "-1" - Dim ObjOP As New ClsCGame - If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then - GvOP.DataSource = ObjOP.DtResultados - GvOP.DataBind() - LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString - If Not ObjOP.DtResultados.Rows.Count > 0 Then - Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia) - Else - TblBusqueda.Visible = True + If ValidarFiltrosSeleccionado() Then + Dim ObjOP As New ClsCGame + If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then + GvOP.DataSource = ObjOP.DtResultados + GvOP.DataBind() + LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString + If Not ObjOP.DtResultados.Rows.Count > 0 Then + Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia) + Else + TblBusqueda.Visible = True + End If End If + ObjOP.Dispose() + UPDatos.Update() + Else + Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia) End If - ObjOP.Dispose() - UPDatos.Update() End Sub Private Sub GvOP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOP.RowDataBound @@ -57,4 +61,13 @@ Partial Class CGame_PopUpBuscarOrdenProduccion e.Row.FCLabel("LblFolio").Text = String.Format("
{0}{1}
", "", e.Row.DBCampo("Folio")) End If End Sub + + Private Function ValidarFiltrosSeleccionado() As Boolean + If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.Length > 0 Then Return True + If TxtFechaEntregaI.Text.Length > 0 Then Return True + If TxtFechaEntregaF.Text.Length > 0 Then Return True + If DdlCliente.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function End Class diff --git a/CRM/PopUpBuscarAcercamiento.aspx.cs b/CRM/PopUpBuscarAcercamiento.aspx.cs index 982fd1a6c..958a4cc7c 100644 --- a/CRM/PopUpBuscarAcercamiento.aspx.cs +++ b/CRM/PopUpBuscarAcercamiento.aspx.cs @@ -164,21 +164,41 @@ public partial class CRM_PopUpBuscarAcercamiento : ClsPaginas string FechaCierre = TxtFechaCierre.Text == "" ? "-1" : TxtFechaCierre.Text; string NombreAcercamiento = TxtAcercamiento.Text == "" ? "-1" : TxtAcercamiento.Text; - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, CveTipoProceso, CveVendedor, "-1", "-1", NombreAcercamiento, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidad, FechaApertura, FechaCierre)) + if (ValidarFiltrosSeleccionados()) { - GVDatos.DataSource = ObjCRM.DtResultados; - GVDatos.DataBind(); + ClsCRM ObjCRM = new ClsCRM(); + if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, CveTipoProceso, CveVendedor, "-1", "-1", NombreAcercamiento, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidad, FechaApertura, FechaCierre)) + { + GVDatos.DataSource = ObjCRM.DtResultados; + GVDatos.DataBind(); - LtlTotalRegistros.Text = ObjCRM.DtResultados.Rows.Count.ToString(); - if (ObjCRM.DtResultados.Rows.Count > 0) - DivBusqueda.Visible = true; - else - DivBusqueda.Visible = false; + LtlTotalRegistros.Text = ObjCRM.DtResultados.Rows.Count.ToString(); + if (ObjCRM.DtResultados.Rows.Count > 0) + DivBusqueda.Visible = true; + else + DivBusqueda.Visible = false; + } + + ObjCRM.Dispose(); + UPDatos.Update(); + }else + { + Alert("Seleccione un criterio de busqueda",ModExtensiones.TipoMensaje.MsgAdvertencia); } + } - ObjCRM.Dispose(); - UPDatos.Update(); + private bool ValidarFiltrosSeleccionados() + { + if (DdlTipoProceso.SelectedValue.ToEntero() > 0) return true; + if (DdlEmpresaCRM.SelectedValue.ToEntero() > 0) return true; + if (DdlVendedor.SelectedValue.ToEntero() > 0) return true; + if (DdlMedioCaptacion.SelectedValue.ToEntero() > 0) return true; + if (DdlRechazoMotivo.SelectedValue.ToEntero() > 0) return true; + if (DdlProbabilidad.SelectedValue.ToEntero() > 0) return true; + if (TxtFechaApertura.Text != "") return true; + if (TxtFechaCierre.Text != "") return true; + if (TxtAcercamiento.Text != "") return true; + return false; } #endregion } \ No newline at end of file diff --git a/Compras/PopUpBuscarProveedor.aspx.vb b/Compras/PopUpBuscarProveedor.aspx.vb index 3480e09ea..e86761bd7 100644 --- a/Compras/PopUpBuscarProveedor.aspx.vb +++ b/Compras/PopUpBuscarProveedor.aspx.vb @@ -60,15 +60,19 @@ Partial Class Compras_PopUpBuscarProveedor If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero - If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, Codigo, RazonSocial, NombreComercial, NombreCorto, RFC, Contacto, Telefono, -1, UsuarioActual.CveEmpresa, CveTipoProveedor:=CveTipoProveedor) Then - If ObjProveedor.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjProveedor.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjProveedor.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ValidarUnFiltroSeleccionado() Then + If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, Codigo, RazonSocial, NombreComercial, NombreCorto, RFC, Contacto, Telefono, -1, UsuarioActual.CveEmpresa, CveTipoProveedor:=CveTipoProveedor) Then + If ObjProveedor.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjProveedor.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjProveedor.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + Else + Alert("Seleccione un criterio de búsqueda", TipoMensaje.MsgAdvertencia) End If ObjProveedor.Dispose() @@ -106,7 +110,7 @@ Partial Class Compras_PopUpBuscarProveedor Case Else Liga = String.Format("", e.Row.DBCampo("CveProveedor")) End Select - + e.Row.FCLiteral("LtlCodigo").Text = String.Format("", Liga, e.Row.DBCampo("Codigo")) e.Row.FCLiteral("LtlRazonSocial").Text = String.Format("
{0}{1}
", Liga, e.Row.DBCampo("RazonSocial")) e.Row.FCLiteral("LtlNombreComercial").Text = String.Format("
{0}{1}
", Liga, e.Row.DBCampo("NombreComercial")) @@ -115,4 +119,16 @@ Partial Class Compras_PopUpBuscarProveedor e.Row.FCLiteral("LtlContacto").Text = String.Format("
{0}{1}
", Liga, e.Row.DBCampo("ContactoNombre")) End If End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtRazonSocial.Text.Trim <> String.Empty Then Return True + If TxtNombreComercial.Text.Trim <> String.Empty Then Return True + If TxtNombreCorto.Text.Trim <> String.Empty Then Return True + If TxtRFC.Text.Trim <> String.Empty Then Return True + If TxtContacto.Text.Trim <> String.Empty Then Return True + If TxtTelefono.Text.Trim <> String.Empty Then Return True + If DdlTipoProveedor.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function End Class diff --git a/Contratos/PopUpBuscarContrato.aspx.vb b/Contratos/PopUpBuscarContrato.aspx.vb index 75ff476e4..b25785ab2 100644 --- a/Contratos/PopUpBuscarContrato.aspx.vb +++ b/Contratos/PopUpBuscarContrato.aspx.vb @@ -125,7 +125,7 @@ Partial Class Contratos_PopUpBuscarContrato End Sub Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click - Dim objContratos As New ClsContratos + Dim NumeroContrato As String = "-1" Dim Estatus As Integer = 1 @@ -141,20 +141,27 @@ Partial Class Contratos_PopUpBuscarContrato If TxtResponsable.Text.Trim.Length > 0 Then Responsable = TxtResponsable.Text If TxtNumeroContrato.Text.Trim.Length > 0 Then NumeroContrato = TxtNumeroContrato.Text - If (objContratos.GetContratosBusquedaRep(DdlTipo.SelectedValue.ToEntero, DdlTipoContrato.SelectedValue.ToEntero, NumeroContrato, Descripcion, - Ubicacion, Responsable, Estatus, DdlProyecto.SelectedValue.ToEntero, DdlSubProtecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, DdlCliente.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero)) Then - GV.DataSource = objContratos.DtResultados - LtlTotalRegistros.Text = objContratos.DtResultados.Rows.Count.ToString + If ValidarUnFiltroSeleccionado() Then + Dim objContratos As New ClsContratos + If (objContratos.GetContratosBusquedaRep(DdlTipo.SelectedValue.ToEntero, DdlTipoContrato.SelectedValue.ToEntero, NumeroContrato, Descripcion, Ubicacion, Responsable, Estatus, + DdlProyecto.SelectedValue.ToEntero, DdlSubProtecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, DdlCliente.SelectedValue.ToEntero, + DdlProveedor.SelectedValue.ToEntero)) Then + GV.DataSource = objContratos.DtResultados + LtlTotalRegistros.Text = objContratos.DtResultados.Rows.Count.ToString + Else + GV.DataSource = Nothing + LtlTotalRegistros.Text = "0" + End If + + + + objContratos.Dispose() + GV.DataBind() + UPDatos.Update() Else - GV.DataSource = Nothing - LtlTotalRegistros.Text = "0" + Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia) End If - - - objContratos.Dispose() - GV.DataBind() - UPDatos.Update() End Sub Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound @@ -173,6 +180,19 @@ Partial Class Contratos_PopUpBuscarContrato End If - End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtDescripcion.Text.Trim.Length > 0 Then Return True + If TxtUbicacion.Text.Trim.Length > 0 Then Return True + If TxtResponsable.Text.Trim.Length > 0 Then Return True + If TxtNumeroContrato.Text.Trim.Length > 0 Then Return True + 'If DdlTipo.SelectedValue.ToEntero > 0 Then Return True + If DdlTipoContrato.SelectedValue.ToEntero > 0 Then Return True + If DdlProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlSubProtecto.SelectedValue.ToEntero > 0 Then Return True + If DdlCliente.SelectedValue.ToEntero > 0 Then Return True + If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function End Class \ No newline at end of file diff --git a/Inventarios/PopUpBuscarMovto.aspx.vb b/Inventarios/PopUpBuscarMovto.aspx.vb index 92994df68..9f5c1dd38 100644 --- a/Inventarios/PopUpBuscarMovto.aspx.vb +++ b/Inventarios/PopUpBuscarMovto.aspx.vb @@ -49,27 +49,38 @@ Partial Class PopUpBuscarFolio CargaDatos() End Sub Private Sub CargaDatos() - Dim Reporte As New ClsInventarios + If ValidarFiltrosSeleccionados() Then + Dim Reporte As New ClsInventarios - Dim FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDate, MinFecha) - Dim FechaFinal = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text.ToDate, MaxFecha) - Dim FechaIngI = If(TxtFechaIngInicio.Text.Trim <> "" AndAlso TxtFechaIngInicio.Text <> "__/__/____", TxtFechaIngInicio.Text.ToDate, MinFecha) - Dim FechaIngF = If(TxtFechaIngFin.Text.Trim <> "" AndAlso TxtFechaIngFin.Text <> "__/__/____", TxtFechaIngFin.Text.ToDate, MaxFecha) + Dim FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDate, MinFecha) + Dim FechaFinal = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text.ToDate, MaxFecha) + Dim FechaIngI = If(TxtFechaIngInicio.Text.Trim <> "" AndAlso TxtFechaIngInicio.Text <> "__/__/____", TxtFechaIngInicio.Text.ToDate, MinFecha) + Dim FechaIngF = If(TxtFechaIngFin.Text.Trim <> "" AndAlso TxtFechaIngFin.Text <> "__/__/____", TxtFechaIngFin.Text.ToDate, MaxFecha) - If Reporte.GetMovimientosRep(DdlAlmacen.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, If(TxtFolio.Text = "", "-1", TxtFolio.Text.Trim).ToEntero, FechaIngI, FechaIngF, FechaInicial, FechaFinal, -1, UsuarioActual.CveEmpresa) Then - GvM.DataSource = Reporte.DtResultados - LtlTotalRegistros.Text = Reporte.DtResultados.Rows.Count.ToString.FormatoNumero(0) + If Reporte.GetMovimientosRep(DdlAlmacen.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, If(TxtFolio.Text = "", "-1", TxtFolio.Text.Trim).ToEntero, + FechaIngI, FechaIngF, FechaInicial, FechaFinal, -1, UsuarioActual.CveEmpresa) Then + GvM.DataSource = Reporte.DtResultados + LtlTotalRegistros.Text = Reporte.DtResultados.Rows.Count.ToString.FormatoNumero(0) + Else + GvM.DataSource = Nothing + End If + + GvM.DataBind() + + UPDatos.Update() + TblBusqueda.Visible = True + Reporte.Dispose() Else - GvM.DataSource = Nothing + Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia) End If - - GvM.DataBind() - - UPDatos.Update() - TblBusqueda.Visible = True - Reporte.Dispose() End Sub + + Private Function ValidarFiltrosSeleccionados() As Boolean + If DdlAlmacen.SelectedValue.ToEntero > 0 Then Return True + If DdlTipoMovimiento.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.Length > 0 Then Return True + Return False + End Function #End Region - End Class diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb index 4f988dc7f..c3bc4fc7c 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb +++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb @@ -94,72 +94,77 @@ Partial Class Inventarios_Default End If End Sub Private Sub CargaDatos(CvePS As Integer, Tipo As Integer) - Dim ObjInventarios As New ClsInventarios() - If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then - Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") - If dr IsNot Nothing Then - LtPs.Text = $"Producto: {dr("PSCodigo").ToString}" - Dim CvePrecioLista As Integer = -1 - If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista - CvePrecioLista = -2 - End If + If ValidarFiltrosSeleccionados() Then + Dim ObjInventarios As New ClsInventarios() + If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then + Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") - Dim ObjVta As New ClsVentas - Dim objPS As New ClsProductosServicios - If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then - If ObjVta.DtResultados.Rows.Count > 0 Then - If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero - If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then - If objPS.DtResultados.Rows.Count > 0 Then - LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}" + If dr IsNot Nothing Then + LtPs.Text = $"Producto: {dr("PSCodigo").ToString}" + Dim CvePrecioLista As Integer = -1 + If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista + CvePrecioLista = -2 + End If + + Dim ObjVta As New ClsVentas + Dim objPS As New ClsProductosServicios + If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then + If ObjVta.DtResultados.Rows.Count > 0 Then + If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero + If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then + If objPS.DtResultados.Rows.Count > 0 Then + LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}" + End If End If End If End If + ObjVta.Dispose() + objPS.Dispose() + If UsuarioActual.CveEmpresa = 119 Then + If CBool(dr("AplicaIEPS")) Then + LtlIEPS.Visible = True + LtlIEPSPorcentaje.Visible = True + LtlIEPSPorcentaje.Text = $"% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}" + Else + LtlIEPS.Visible = False + LtlIEPSPorcentaje.Visible = False + End If + If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then + LtlIVA.Visible = True + LtlIVAPorcentaje.Visible = True + LtlIVAPorcentaje.Text = $"Si" + Else + LtlIVA.Visible = False + LtlIVAPorcentaje.Visible = False + End If + End If End If - ObjVta.Dispose() - objPS.Dispose() - If UsuarioActual.CveEmpresa = 119 Then - If CBool(dr("AplicaIEPS")) Then - LtlIEPS.Visible = True - LtlIEPSPorcentaje.Visible = True - LtlIEPSPorcentaje.Text = $"% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}" - Else - LtlIEPS.Visible = False - LtlIEPSPorcentaje.Visible = False - End If - If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then - LtlIVA.Visible = True - LtlIVAPorcentaje.Visible = True - LtlIVAPorcentaje.Text = $"Si" - Else - LtlIVA.Visible = False - LtlIVAPorcentaje.Visible = False - End If + + If UsuarioActual.CveUsuario = 100 Then + HlPendiente.Visible = True + HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS) + End If + + If ObjInventarios.DtResultados.Rows.Count > 0 Then + GV.DataSource = ObjInventarios.DtResultados + Else + GV.DataSource = Nothing + Dim Js = If(Tipo = 1, "", "window.setTimeout(Focus,200);") + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) End If End If - If UsuarioActual.CveUsuario = 100 Then - HlPendiente.Visible = True - HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS) - End If + ObjInventarios.Dispose() + GV.DataBind() - If ObjInventarios.DtResultados.Rows.Count > 0 Then - GV.DataSource = ObjInventarios.DtResultados - Else - GV.DataSource = Nothing - Dim Js = If(Tipo = 1, "", "window.setTimeout(Focus,200);") - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) - End If + + + UPDatos.Update() + TblBusqueda.Visible = True + Else + Alert("Seleccione un producto o servicio", TipoMensaje.MsgAdvertencia) End If - - ObjInventarios.Dispose() - GV.DataBind() - - - - UPDatos.Update() - TblBusqueda.Visible = True End Sub Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -227,6 +232,7 @@ Partial Class Inventarios_Default End Sub Private Sub CargarDatosMedRin() + Dim ObjInventarios As New ClsInventarios If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then GvMedRin.DataSource = ObjInventarios.DtResultados @@ -236,4 +242,9 @@ Partial Class Inventarios_Default UPDatos.Update() End Sub + Private Function ValidarFiltrosSeleccionados() As Boolean + If DDlPS.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + End Class diff --git a/OC/PopUpBuscarReq.aspx.vb b/OC/PopUpBuscarReq.aspx.vb index 814797b58..043715c23 100644 --- a/OC/PopUpBuscarReq.aspx.vb +++ b/OC/PopUpBuscarReq.aspx.vb @@ -168,17 +168,23 @@ Partial Class OC_PopUpBuscarReq Dim FI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate) Dim guia As String = If(TxtGuia.Text.Trim = "", "-1", TxtGuia.Text) 'Cargar Datos - Dim ObjOC As New ClsOC - ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, DdlProveedor.SelectedValue.ToEntero, If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia, - SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False)) - Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial - ObjOC.Dispose() - GV.DataSource = DtOC - GV.DataBind() - LtlTotalRegistros.Text = GV.Rows.Count.ToString - LblTotalRegistros.Text = "Número de registros: " - UPDatos.Update() + If ValidarFiltrosSeleccionado() Then + Dim ObjOC As New ClsOC + ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, DdlProveedor.SelectedValue.ToEntero, + If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia, + SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False)) + Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial + ObjOC.Dispose() + + GV.DataSource = DtOC + GV.DataBind() + LtlTotalRegistros.Text = GV.Rows.Count.ToString + LblTotalRegistros.Text = "Número de registros: " + UPDatos.Update() + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) + End If End Sub Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then @@ -245,6 +251,17 @@ Partial Class OC_PopUpBuscarReq End If End Sub + + Private Function ValidarFiltrosSeleccionado() As Boolean + If DdlTipo.SelectedValue.ToEntero > 0 Then Return True + If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.ToEntero > 0 Then Return True + If DdlSubProyectos.SelectedValue.ToEntero > 0 Then Return True + If DdlProyectos.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + #End Region #Region " VINCULA CON COMPRAS " diff --git a/OS/PopUpBuscarOS.aspx.vb b/OS/PopUpBuscarOS.aspx.vb index eca09e56b..3e288a7f4 100644 --- a/OS/PopUpBuscarOS.aspx.vb +++ b/OS/PopUpBuscarOS.aspx.vb @@ -35,16 +35,19 @@ Partial Class OS_PopUpBuscarOS 'If TxtFechaRecibido.Text.Trim <> String.Empty Then FechaRecibido.ToString() If DdlEstatusOrdenServicio.SelectedValue <> String.Empty Then CveEstatusOrdenServicio = DdlEstatusOrdenServicio.SelectedValue.ToEntero - - If ObjOS.GetOrdenesServicios(-1, CveCliente, Folio, CveUsuarioRecibio, CveEstatusOrdenServicio, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then - If ObjOS.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjOS.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjOS.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ValidarUnFiltroSeleccionado() Then + If ObjOS.GetOrdenesServicios(-1, CveCliente, Folio, CveUsuarioRecibio, CveEstatusOrdenServicio, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then + If ObjOS.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjOS.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjOS.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + Else + Alert("Seleccione un criterio de búsqueda", TipoMensaje.MsgAdvertencia) End If ObjOS.Dispose() @@ -108,4 +111,13 @@ Partial Class OS_PopUpBuscarOS DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) End Sub + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtFolio.Text.Trim <> String.Empty Then Return True + If DdlCliente.SelectedValue.ToEntero > 0 Then Return True + If DdlUsuarioRecibio.SelectedValue.ToEntero > 0 Then Return True + 'If TxtFechaRecibido.Text.Trim <> String.Empty Then FechaRecibido.ToString() + If DdlEstatusOrdenServicio.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + End Class diff --git a/RH/PopUpBuscarPersonal.aspx.vb b/RH/PopUpBuscarPersonal.aspx.vb index e9d5cab16..78389afb8 100644 --- a/RH/PopUpBuscarPersonal.aspx.vb +++ b/RH/PopUpBuscarPersonal.aspx.vb @@ -383,4 +383,14 @@ Partial Class RH_PopUpBuscarPersonal End If End Sub + + Private Function ValidarFiltrosSeleccionado() As Boolean + If TxtCodigo.Text.Trim = String.Empty Then Return True + If TxtNombre.Text.Trim = String.Empty Then Return True + If TxtNSS.Text.Trim = String.Empty Then Return True + If TxtRFC.Text.Trim = String.Empty Then Return True + If TxtHorarioDe.Text.Trim = String.Empty Then Return True + Return False + End Function + End Class diff --git a/Ventas/PopUpBuscarPs.aspx.vb b/Ventas/PopUpBuscarPs.aspx.vb index f5baa1e9e..aa2cce4bb 100644 --- a/Ventas/PopUpBuscarPs.aspx.vb +++ b/Ventas/PopUpBuscarPs.aspx.vb @@ -91,6 +91,12 @@ Partial Class PopUpBuscarPs End Sub #End Region + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtCodigoBarras.Text.Trim <> String.Empty Then Return True + If TxtNombre.Text.Trim <> String.Empty Then Return True + Return False + End Function End Class From 757943a921e9f928c70a2abcba6ba4ebd72690b9 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 29 May 2020 22:06:19 -0700 Subject: [PATCH 03/55] validacion de los filtros de los pop up --- Compras/PopUpBuscarFolioC.aspx.vb | 46 +++++++++++------ Compras/RepRembolsoComprobaciones.aspx.vb | 15 ++++++ RH/PopUpBuscarPersonal.aspx.vb | 59 ++++++++++++++-------- Ventas/PopUpBuscarClientes.aspx.vb | 61 +++++++++++++++-------- Ventas/PopUpBuscarFolio.aspx.vb | 55 ++++++++++++++------ Ventas/PopUpBuscarPs.aspx.vb | 33 ++++++++---- 6 files changed, 184 insertions(+), 85 deletions(-) diff --git a/Compras/PopUpBuscarFolioC.aspx.vb b/Compras/PopUpBuscarFolioC.aspx.vb index 78a011566..07f3e27be 100644 --- a/Compras/PopUpBuscarFolioC.aspx.vb +++ b/Compras/PopUpBuscarFolioC.aspx.vb @@ -38,7 +38,6 @@ Partial Class Compras_PopUpBuscarFolioC Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjCompras As New ClsCompras() Dim Folio As String = "-1" Dim FolioFiscal As String = "-1" @@ -55,23 +54,29 @@ Partial Class Compras_PopUpBuscarFolioC Descripcion = If(TxtDescripcion.Text.Trim = "", "-1", TxtDescripcion.Text.Trim) Obs = If(TxtObservaciones.Text.Trim = "", "-1", TxtObservaciones.Text.Trim) - If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Folio, FolioFiscal, Codigo, Proveedor, FechaI, FechaF, Descripcion, Obs, CveProveedor:=DdlProveedor.SelectedValue.ToEntero) Then - If ObjCompras.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjCompras.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjCompras.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ValidarUnFiltroSeleccionado() Then + Dim ObjCompras As New ClsCompras() + If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Folio, FolioFiscal, Codigo, Proveedor, FechaI, FechaF, Descripcion, Obs, + CveProveedor:=DdlProveedor.SelectedValue.ToEntero) Then + If ObjCompras.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjCompras.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjCompras.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + + ObjCompras.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjCompras.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -100,5 +105,14 @@ Partial Class Compras_PopUpBuscarFolioC End If End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtFolio.Text.Trim.Length > 0 Then Return True + If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True + If TxtDescripcion.Text.Trim.Length > 0 Then Return True + If TxtObservaciones.Text.Trim.Length > 0 Then Return True + If DdlTipoDocto.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function End Class diff --git a/Compras/RepRembolsoComprobaciones.aspx.vb b/Compras/RepRembolsoComprobaciones.aspx.vb index 20803e964..cbf7068ce 100644 --- a/Compras/RepRembolsoComprobaciones.aspx.vb +++ b/Compras/RepRembolsoComprobaciones.aspx.vb @@ -340,6 +340,21 @@ Partial Class Compras_RepRembolsoComprobaciones params.Add(New ReportParameter("Autorizo", "")) params.Add(New ReportParameter("ElaboroPuesto", "")) params.Add(New ReportParameter("AutorizoPuesto", "")) + + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString)) + params.Add(New ReportParameter("CveCajaChica", DtDatos.Rows(0)("CveCajaChica").ToString)) + params.Add(New ReportParameter("CveFyE", "0")) ' + + params.Add(New ReportParameter("cuentaRetiro", "Cuenta retiro: " & "")) + params.Add(New ReportParameter("CajaChica", "Caja chica: " & "")) + params.Add(New ReportParameter("observaciones", "Observaciones: " & "")) + params.Add(New ReportParameter("folio", DtDatos.Rows(0)("Folio").ToString)) + params.Add(New ReportParameter("fecha", "")) + params.Add(New ReportParameter("importe", "")) + params.Add(New ReportParameter("TotAbono", DtDatos.SUM("Abonado").ToString)) + ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras") Else params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) diff --git a/RH/PopUpBuscarPersonal.aspx.vb b/RH/PopUpBuscarPersonal.aspx.vb index 78389afb8..06a779f57 100644 --- a/RH/PopUpBuscarPersonal.aspx.vb +++ b/RH/PopUpBuscarPersonal.aspx.vb @@ -142,7 +142,6 @@ Partial Class RH_PopUpBuscarPersonal End Sub Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjPersonal As New ClsRH() Dim Codigo As String = "-1" Dim Nombre As String = "-1" @@ -161,26 +160,32 @@ Partial Class RH_PopUpBuscarPersonal Dim StrFiltroCaracteristica As String = GeneraFiltroCaracteristicas() - If ObjPersonal.GetPersonal2(-1, Codigo, Nombre, NSS, RFC, DdlTurnos.SelectedValue.ToEntero, DdlPuestos.SelectedValue.ToEntero, DdlDepartamentos.SelectedValue.ToEntero, + If ValidarFiltrosSeleccionado() Then + + Dim ObjPersonal As New ClsRH() + If ObjPersonal.GetPersonal2(-1, Codigo, Nombre, NSS, RFC, DdlTurnos.SelectedValue.ToEntero, DdlPuestos.SelectedValue.ToEntero, DdlDepartamentos.SelectedValue.ToEntero, DdlRuta.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, DdlEstadoCivil.SelectedValue.ToEntero, DdlGenero.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClienteAsignado.SelectedValue.ToEntero, Horario, CveSupervisor, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", StrFiltroCaracteristica, 1, UsuarioActual.CveEmpresa) Then - If ObjPersonal.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjPersonal.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjPersonal.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ObjPersonal.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjPersonal.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjPersonal.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + + ObjPersonal.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjPersonal.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Private Function GeneraFiltroCaracteristicas() As String @@ -385,11 +390,23 @@ Partial Class RH_PopUpBuscarPersonal End Sub Private Function ValidarFiltrosSeleccionado() As Boolean - If TxtCodigo.Text.Trim = String.Empty Then Return True - If TxtNombre.Text.Trim = String.Empty Then Return True - If TxtNSS.Text.Trim = String.Empty Then Return True - If TxtRFC.Text.Trim = String.Empty Then Return True - If TxtHorarioDe.Text.Trim = String.Empty Then Return True + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtNombre.Text.Trim <> String.Empty Then Return True + If TxtNSS.Text.Trim <> String.Empty Then Return True + If TxtRFC.Text.Trim <> String.Empty Then Return True + If TxtHorarioDe.Text.Trim <> String.Empty Then Return True + + If DdlTurnos.SelectedValue.ToEntero > 0 Then Return True + If DdlPuestos.SelectedValue.ToEntero > 0 Then Return True + If DdlDepartamentos.SelectedValue.ToEntero > 0 Then Return True + If DdlRuta.SelectedValue.ToEntero > 0 Then Return True + If DdlEscolaridad.SelectedValue.ToEntero > 0 Then Return True + If DdlEstadoCivil.SelectedValue.ToEntero > 0 Then Return True + If DdlGenero.SelectedValue.ToEntero > 0 Then Return True + If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlClienteAsignado.SelectedValue.ToEntero > 0 Then Return True + Return False End Function diff --git a/Ventas/PopUpBuscarClientes.aspx.vb b/Ventas/PopUpBuscarClientes.aspx.vb index b1d247a43..96af8f67b 100644 --- a/Ventas/PopUpBuscarClientes.aspx.vb +++ b/Ventas/PopUpBuscarClientes.aspx.vb @@ -54,7 +54,6 @@ Partial Class PopUpBuscarClientes End Sub Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjClientes As New ClsClientes() Dim Nombre As String = "-1" Dim Codigo As String = "-1" @@ -70,30 +69,37 @@ Partial Class PopUpBuscarClientes If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim If TxtMail.Text.Trim <> String.Empty Then Mail = TxtMail.Text.Trim - If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente) Then - If ObjClientes.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjClientes.DtResultados - If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then - GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (10450, 10460, 10458)") - LtlTotalRegistros.Text = "0" - ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then - GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (27448)") + If ValidarUnFiltroSeleccionado() Then + + Dim ObjClientes As New ClsClientes() + If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, + DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente) Then + If ObjClientes.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjClientes.DtResultados + If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then + GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (10450, 10460, 10458)") + LtlTotalRegistros.Text = "0" + ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then + GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (27448)") + LtlTotalRegistros.Text = "0" + End If + Else LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) End If - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) End If + + ObjClientes.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjClientes.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound @@ -127,4 +133,17 @@ Partial Class PopUpBuscarClientes e.Row.FCLiteral("LtlMail").Text = String.Format("
{0}{1}
", Liga, e.Row.DBCampo("Mail")) End If End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtNombre.Text.Trim <> String.Empty Then Return True + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtNombreCorto.Text.Trim <> String.Empty Then Return True + If TxtRFC.Text.Trim <> String.Empty Then Return True + If TxtTelefono.Text.Trim <> String.Empty Then Return True + If TxtMail.Text.Trim <> String.Empty Then Return True + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + End Class diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb index f5dc1d44e..e2c6711cd 100644 --- a/Ventas/PopUpBuscarFolio.aspx.vb +++ b/Ventas/PopUpBuscarFolio.aspx.vb @@ -88,7 +88,6 @@ Partial Class PopUpBuscarFolio Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjVentas As New ClsVentas() Dim Serie As String = "-1" Dim Folio As Integer = -1 @@ -123,23 +122,31 @@ Partial Class PopUpBuscarFolio PeidoContrato = If(TxtPedidoContrato.Text.Length = 0, "-1", TxtPedidoContrato.Text.Trim) OrdenCompra = If(TxtOrdenCompra.Text.Length = 0, "-1", TxtOrdenCompra.Text.Trim) - If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1), DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - If ObjVentas.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjVentas.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ValidarUnFiltroSeleccionado() Then + + Dim ObjVentas As New ClsVentas() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, + DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1), + DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjVentas.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + + ObjVentas.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjVentas.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound @@ -271,4 +278,20 @@ Partial Class PopUpBuscarFolio DdlEstatusFactura.Items.Add(New ListItem("Todos", "-1")) DdlEstatusFactura.DataBind() End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If DdlTipoDocto.SelectedValue.ToEntero > 0 Then Return True + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True + If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True + If DdlPS.SelectedValue.ToEntero > 0 Then Return True + + If DdlNombre.SelectedValue.ToEntero > 0 Then Return True + If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True + If TxtPedidoContrato.Text.Length > 0 Then Return True + If TxtOrdenCompra.Text.Length > 0 Then Return True + + Return False + + End Function End Class diff --git a/Ventas/PopUpBuscarPs.aspx.vb b/Ventas/PopUpBuscarPs.aspx.vb index aa2cce4bb..44825d642 100644 --- a/Ventas/PopUpBuscarPs.aspx.vb +++ b/Ventas/PopUpBuscarPs.aspx.vb @@ -64,18 +64,24 @@ Partial Class PopUpBuscarPs If TxtCodigoBarras.Text.Trim = "" Then CodigoBarras = "-1" Else CodigoBarras = TxtCodigoBarras.Text.Trim If TxtNombre.Text = "" Then Nombre = "-1" Else Nombre = TxtNombre.Text.ToUpper - Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPS(-1, Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Codigo:=Codigo, CodigoBarras:=CodigoBarras, PS:=Nombre, pEstado:=DdlEstado.SelectedValue.ToEntero, CveTipoPS:=DdlCveTipoPS.SelectedValue.ToEntero, pAplicaParaVenta:=DdlAplicaVenta.SelectedValue.ToEntero, CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero) Then - GvDatos.DataSource = ObjPS.DtResultados - dvbusqueda.Visible = True - Else - GvDatos.DataSource = Nothing - dvbusqueda.Visible = False - End If - ObjPS.Dispose() + If ValidarUnFiltroSeleccionado() Then + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPS(-1, Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Codigo:=Codigo, CodigoBarras:=CodigoBarras, PS:=Nombre, + pEstado:=DdlEstado.SelectedValue.ToEntero, CveTipoPS:=DdlCveTipoPS.SelectedValue.ToEntero, pAplicaParaVenta:=DdlAplicaVenta.SelectedValue.ToEntero, + CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero) Then + GvDatos.DataSource = ObjPS.DtResultados + dvbusqueda.Visible = True + Else + GvDatos.DataSource = Nothing + dvbusqueda.Visible = False + End If + ObjPS.Dispose() - GvDatos.DataBind() - GvDatos.UseAccessibleHeader = True + GvDatos.DataBind() + GvDatos.UseAccessibleHeader = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) + End If End Sub #End Region @@ -95,6 +101,11 @@ Partial Class PopUpBuscarPs If TxtCodigo.Text.Trim <> String.Empty Then Return True If TxtCodigoBarras.Text.Trim <> String.Empty Then Return True If TxtNombre.Text.Trim <> String.Empty Then Return True + + If DdlCveTipoPS.SelectedValue.ToEntero > 0 Then Return True + If DdlAplicaVenta.SelectedValue.ToEntero > 0 Then Return True + If DdlCompuesto.SelectedValue.ToEntero > 0 Then Return True + Return False End Function From 4ec20ede1cadeb07e7e38c3fbfce98f12c95f89d Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 30 May 2020 10:28:07 -0700 Subject: [PATCH 04/55] Metodo de existencias en base a la tabla --- App_Code/ClsProductosServicios.vb | 42 +++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 02e26a446..4160a2279 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -1838,9 +1838,47 @@ Public Class ClsProductosServicios End Try Return Retorno - End Function -#End Region + End Function + Public Function GetPSExistenciasWS(CvePS As Integer, CvePrecioLista 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, + Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, + Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProductosExistenciasWSGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista + .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) + .Add("@Serie", SqlDbType.VarChar).Value = Serie + .Add("@Lote", SqlDbType.VarChar).Value = Lote + .Add("@Batch", SqlDbType.VarChar).Value = Batch + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado + .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir + .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados + .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + #Region "Porcentaje Productos" Public Function GetPorcentajeProductos(CveCliente As Integer) As Boolean Dim Retorno As Boolean = False From 1ffb59e10f9f7feb5686abf50cbf17350d2e1864 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 30 May 2020 14:58:17 -0700 Subject: [PATCH 05/55] - quitar globalFolios --- App_Code/ClsPaginas.vb | 9 +-------- Global.asax | 19 +++++++------------ 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6c1eaf2e6..fd1b013bf 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -851,14 +851,7 @@ Public Class ClsPaginas Application("GlobalDTLeyendasFiscales") = value End Set End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTFolios") = value - End Set - End Property + Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(Application("GlobalDTEstatusFactura"), DataTable) diff --git a/Global.asax b/Global.asax index 11fea0e3e..d2a87c94f 100644 --- a/Global.asax +++ b/Global.asax @@ -356,18 +356,13 @@ Dim ObjLeyendasFiscales As New ClsLeyendasFiscales() If ObjLeyendasFiscales.GetLeyendasFiscales() Then Application("GlobalDTLeyendasFiscales") = ObjLeyendasFiscales.DtResultados Else Application("GlobalDTLeyendasFiscales") = Nothing - ObjLeyendasFiscales.Dispose() - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C A R G A - F O L I O S - - Dim ObjFolios As New ClsGralFolios() - If ObjFolios.GetFolios() Then Application("GlobalDTFolios") = ObjFolios.DtResultados Else Application("GlobalDTFolios") = Nothing - ObjFolios.Dispose() - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'F A C T U R A S - + ObjLeyendasFiscales.Dispose() + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'F A C T U R A S + Dim ObjEstatusFactura As New ClsEstatusFactura() If ObjEstatusFactura.GetEstatusFactura() Then Application("GlobalDTEstatusFactura") = ObjEstatusFactura.DtResultados Else Application("GlobalDTEstatusFactura") = Nothing ObjEstatusFactura.Dispose() From b34ab76fd34363bb5cf0e068409cec5d16d8a87e Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 30 May 2020 14:58:29 -0700 Subject: [PATCH 06/55] --ajustes serie/folio --- App_Code/ClsInventarios.vb | 6 ------ Compras/Compras.aspx.vb | 2 +- Contratos/RepContratosCostos.aspx | 2 +- Inventarios/Apartados.aspx | 6 +++--- Inventarios/Apartados.aspx.vb | 3 ++- Inventarios/EntradasSalidas.aspx | 4 ++-- Inventarios/EntradasSalidas.aspx.vb | 18 ++++++------------ Inventarios/RecepcionAlmacen.aspx.vb | 17 +++++++++-------- Inventarios/ResguardoMaterial.aspx.vb | 6 +++--- Inventarios/TraspasoAlmacen.aspx.vb | 2 +- Ventas/Ventas.aspx.vb | 2 +- asmx/WSApp.asmx | 10 +++++----- 12 files changed, 34 insertions(+), 44 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 6f2ebaad9..6de25b9d9 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1147,12 +1147,6 @@ Public Class ClsInventarios End With Try SqlAdapter.Fill(Data) - - If Data IsNot Nothing AndAlso Data.Rows.Count >= 1 Then - Dim dr As DataRow = Data.Rows(0) - CveSeccion = dr("CveSeccionAlmacen").ToString.ToEntero - End If - Retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener los movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 552b2f736..69e205ef3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6591,7 +6591,7 @@ Partial Class Compras_Compras Next 'calcula la diferencia entre lo recibido por la OC, considerando costos indirectos y lo que se ingresaria en la compra - SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * 1).RoundSQL 'sumatoria de la factura + SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * TCO).RoundSQL 'sumatoria de la factura If SumatoriaOCINV.RoundSQL <> 0 Then ' se abona el costo, cambiamos su naturaleza 'SumatoriaOCINV = -SumatoriaOCINV diff --git a/Contratos/RepContratosCostos.aspx b/Contratos/RepContratosCostos.aspx index 0711f2a7b..bf7c217b9 100644 --- a/Contratos/RepContratosCostos.aspx +++ b/Contratos/RepContratosCostos.aspx @@ -134,7 +134,7 @@ - + diff --git a/Inventarios/Apartados.aspx b/Inventarios/Apartados.aspx index 57bf1f423..36a17a7c0 100644 --- a/Inventarios/Apartados.aspx +++ b/Inventarios/Apartados.aspx @@ -86,7 +86,7 @@
- +
@@ -203,7 +203,7 @@
- +
@@ -310,7 +310,7 @@
Cliente
- + <%-- diff --git a/Inventarios/Apartados.aspx.vb b/Inventarios/Apartados.aspx.vb index db73531dd..f10ca6247 100644 --- a/Inventarios/Apartados.aspx.vb +++ b/Inventarios/Apartados.aspx.vb @@ -466,7 +466,8 @@ Partial Class Inventarios_Apartados Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, "-1")) If Valido Then - AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Text <> "", TxtnSerie.Text, ""), Limpia:=FuncionalidadSinSerie) + Dim StrSeccion As String = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedItem.Text, "") + AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=StrSeccion, Serie:=If(TxtnSerie.Text <> "", TxtnSerie.Text, ""), Limpia:=FuncionalidadSinSerie) End If End If diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 7cd2b7882..393d66ab9 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -255,9 +255,9 @@
- +
- +
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index b7acf9b87..2146c8de4 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -463,10 +463,6 @@ Partial Class Inventarios_EntradasSalidas End If DdlClasificacion.DataBind() - DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlSeccion.DataBind() - DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) DdlSeccionAlmacen.DataBind() @@ -825,7 +821,7 @@ Partial Class Inventarios_EntradasSalidas 'cargar también los movimentos detalle If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DdlSeccion.SelectedValueExist(Mov.CveSeccion.ToString) + DtMovimientos = Mov.DtResultados.FiltraParametros("", "CveMovimientoDetalle") DtMovimientos.Columns("No").AutoIncrement = True @@ -929,7 +925,6 @@ Partial Class Inventarios_EntradasSalidas TxtObservaciones.Enabled = True DdlMoneda.Enabled = True TxtGuia.Enabled = True - DdlSeccion.Enabled = True If CveMovimiento > 0 Then DdlAlmacen.Enabled = False @@ -940,7 +935,7 @@ Partial Class Inventarios_EntradasSalidas TxtObservaciones.Enabled = False DdlMoneda.Enabled = False TxtGuia.Enabled = False - DdlSeccion.Enabled = False + End If UppGrid.Update() End Sub @@ -2233,10 +2228,10 @@ Partial Class Inventarios_EntradasSalidas End If If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then - GvM.Columns(9).Visible = DtTemp.MAX("Serie").ToString <> "" - GvM.Columns(10).Visible = DtTemp.MAX("Lote").ToString <> "" - GvM.Columns(11).Visible = DtTemp.MAX("FechaCaducidad").ToString <> "" - GvM.Columns(12).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString <> "" + GvM.Columns(9).Visible = DtTemp.MAX("Serie") <> "" + GvM.Columns(10).Visible = DtTemp.MAX("Lote") <> "" + GvM.Columns(11).Visible = DtTemp.MAX("FechaCaducidad").ToDate > MinFecha + GvM.Columns(12).Visible = DtTemp.MAX("CveSeccionAlmacen") <> "" End If @@ -4042,7 +4037,6 @@ Partial Class Inventarios_EntradasSalidas If TxtRemision.Visible Then TxtRemision.Enabled = True If DdlMoneda.Visible Then DdlMoneda.Enabled = True If TxtGuia.Visible Then TxtGuia.Enabled = True - If DdlSeccion.Visible Then DdlSeccion.Enabled = True If BtnEliminar.Visible Then BtnEliminar.Visible = False diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 893e3be4c..f0f919c1a 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -479,7 +479,8 @@ Partial Class Inventarios_RecepcionAlmacen Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacen.SelectedIndexChanged If DdlAlmacen.SelectedValue <> "-1" Then - CargaCompra(CveCompraSurtir, CveProveedor) + + CargaGVInv() 'For Each Gvr As GridViewRow In GvInv.Rows ' If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then ' Dim Dr As DataRow = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("") @@ -1263,7 +1264,7 @@ Partial Class Inventarios_RecepcionAlmacen If CBool(e.Row.DBCampo("AplicaSeccion")) Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True If DdlAlmacen.SelectedValue.ToEntero > 0 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) End If @@ -2192,7 +2193,7 @@ Partial Class Inventarios_RecepcionAlmacen 'ENTRADA ALMACÉN CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, If(TipoMovimiento > 1, 13, 2), 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), - MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G") + MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1") If CveMovimiento > 0 Then InvFolio = ObjInventario.Folio.ToString Dim DtDetalle As New DataTable @@ -2311,7 +2312,7 @@ Partial Class Inventarios_RecepcionAlmacen CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), - MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G") + MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G2") FolioSalidaDirecta = ObjInventario.Folio If Not CveMovtoSalidaDirecta > 0 Then @@ -2365,7 +2366,7 @@ Partial Class Inventarios_RecepcionAlmacen If CveVendedorActual = -1 Or (Dr("CveVendedor").ToString.ToEntero <> CveVendedorActual Or Dr("CveCliente").ToString.ToEntero <> CveClienteActual) Then CveMovtoSalidaActual = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), CveAlmacenDestino:=CveAlmacenDestino, MovimientoFijo:=True, CveVendedor:=Dr("CveVendedor").ToString.ToEntero, - CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text, Modulo:="RA/G") + CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text, Modulo:="RA/G3") MovtosSalida.Add(CveMovtoSalidaActual) FoliosSalida.Add(ObjInventario.Folio) @@ -2447,7 +2448,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacenFiltro).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4") FolioVirtual = ObjInventario.Folio For Each RowUsado As DataRow In DtPSVirtual.Rows @@ -2590,7 +2591,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G5") FolioVirtual = ObjInventario.Folio For Each RowUsado As DataRow In DtPSVirtual.Rows @@ -3048,7 +3049,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjContaAC As ClsContPAQi = Nothing 'ENTRADA ALMACÉN - CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 2, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveImportacionCompra, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=-1, Remision:=TxtRemision.Text, Modulo:="RA/G") + CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 2, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveImportacionCompra, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=-1, Remision:=TxtRemision.Text, Modulo:="RA/G6") If CveMovimiento > 0 Then InvFolio = ObjInventario.Folio.ToString Dim DtDetalle As New DataTable diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index aad0f3987..9aabeb893 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -608,7 +608,7 @@ Partial Class Inventarios_ResguardoMaterial Private Sub CargaGvMLiberacion() GvM.Columns(5).Visible = False For Each Dr As DataRow In DtMovimientosLiberacion.Rows - If Dr("SerieLote").ToString <> "" Then + If Dr("Serie").ToString <> "" Then GvM.Columns(5).Visible = True Exit For End If @@ -777,7 +777,7 @@ Partial Class Inventarios_ResguardoMaterial Dim Cont As Integer = 0 For Each Dr As DataRow In DtMovimientos.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For @@ -796,7 +796,7 @@ Partial Class Inventarios_ResguardoMaterial Else If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" Exit For diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 55ee7d78a..752c30d04 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -855,7 +855,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim Cont As Integer = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacenDestino").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de entrada" Exit For diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f59b0d4b3..38d4248d4 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10186,7 +10186,7 @@ Partial Class Ventas Exit For Else ViewState("SeGuardoPrePoliza") = True - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 2, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=importeMovimiento, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, CveIE:=CveIEAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 2, Concepto, FechaMovimiento, ObjFactura.Cliente.IdCtaContClientes, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=importeMovimiento, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, CveIE:=CveIEAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then ErrorPrepoliza = True Exit For End If diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 88b6270ad..5bf108a04 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -1122,7 +1122,7 @@ Public Class WSApp TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("CveTipoPS", GetType(Integer)) TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer)) - TmpDT.Columns.Add("SerieLote", GetType(String)) + TmpDT.Columns.Add("Serie", GetType(String)) TmpDT.Columns.Add("CuentaPredial", GetType(String)) TmpDT.Columns.Add("Obs", GetType(String)) TmpDT.Columns.Add("TiempoEntrega", GetType(String)) @@ -1210,7 +1210,7 @@ Public Class WSApp TmpDT.Columns.Add("CveUM", GetType(Integer)) TmpDT.Columns.Add("Cantidad", GetType(Decimal)) TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer)) - TmpDT.Columns.Add("SerieLote", GetType(String)) + TmpDT.Columns.Add("Serie", GetType(String)) TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer)) For Each Dr As DataRow In DtDetalle.FiltraParametros("CveTipoPS = 2").Rows @@ -1219,7 +1219,7 @@ Public Class WSApp ss("CveUM") = Dr("CveUM") ss("Cantidad") = Dr("Cantidad") ss("CveTipoInvPS") = Dr("CveTipoInvPS") - ss("SerieLote") = Dr("SerieLote") + ss("Serie") = Dr("Serie") ss("CveVentaDetalle") = -1 TmpDT.Rows.Add(ss) @@ -1228,7 +1228,7 @@ Public Class WSApp Return TmpDT End Function Private Function AgregarProductoServicio(ByRef Retorno As Modelos.Factura.MMensajeFactura, TmpDT As DataTable, PS As MVentaProductos, CveEmpresa As Integer, CvePrecioLista As Integer, CveSubProyecto As Integer, - Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0, + Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0, Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, @@ -1290,7 +1290,7 @@ Public Class WSApp Row("Proyecto") = DrSubProyecto("Proyecto").ToString() Row("CveSubProyecto") = CveSubProyecto Row("SubProyecto") = DrSubProyecto("SubProyecto").ToString() - Row("SerieLote") = SerieLote + Row("Serie") = Serie Row("TiempoEntrega") = TiempoEntrega Row("Orden") = TmpDT.Rows.Count + 1 Row("Cantidad") = PS.Cantidad From 393aaa507ecf7efc8aaa1747a5f1253feb1e4606 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 30 May 2020 15:24:39 -0700 Subject: [PATCH 07/55] =?UTF-8?q?Correccion=20en=20Surtir=20refacturaci?= =?UTF-8?q?=C3=B3n=20parcial=20o=20total?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 2 +- Inventarios/EntregaAlmacen.aspx.vb | 5 +++-- Ventas/Ventas.aspx.vb | 23 +++++++++++++---------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 6f2ebaad9..eb17829bb 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2949,7 +2949,7 @@ Public Class ClsInventarios DataAdapter("Vta_UpdateDevolucionVentaDetalle") With SqlAdapter.SelectCommand.Parameters - .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta + .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle .Add("@Valor", SqlDbType.Int).Value = Valor End With diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 87b0ad449..f5b2187dc 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -660,8 +660,9 @@ Partial Class Inventarios_EntregaAlmacen Alert("Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar.", TipoMensaje.MsgError) End If End If - - CargaDocumentos(CveVenta) + If UsuarioActual.Empresa.FacturaProduccion Then + CargaDocumentos(CveVenta) + End If Else Alert("No se encontraron productos pendientes por surtir. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f59b0d4b3..14a5ca549 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5152,7 +5152,9 @@ Partial Class Ventas CargarAlmacenes() - CargaDocumentacionCliente() + If UsuarioActual.Empresa.FacturaProduccion Then + CargaDocumentacionCliente() + End If If UsuarioActual.CveEmpresa.Contiene(72, 80, 1, 119) Then BtnEmitirImprimir.OnClientClick = $"ValidaGuardar({ If(ImprimeNombreSucursal = True, 1, 0)});" @@ -7029,7 +7031,7 @@ Partial Class Ventas 'MARCA LO PENDIENTE A NIVEL DETALLE Dim DtMovDetalles As DataTable = Nothing - If ObjInventario.GetSaldoVentaDetalle(ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetSaldoVentaDetalle(CveDevolucion, UsuarioActual.CveEmpresa) Then DtMovDetalles = ObjInventario.DtResultados.Copy() End If @@ -7037,9 +7039,9 @@ Partial Class Ventas For Each Row As DataRow In DtMovDetalles.Rows Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToEntero() If SaldoAlmacen < 0 Then - ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalle").ToString().ToEntero(), 1) + ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalleNueva").ToString().ToEntero(), 1) ElseIf SaldoAlmacen = 0 Then - ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalle").ToString().ToEntero(), 0) + ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalleNueva").ToString().ToEntero(), 0) End If Next End If @@ -19451,6 +19453,7 @@ Partial Class Ventas Private Sub CancelarDocumento(Optional EsRefacturacion As Boolean = False) + Dim LigaRedirigir As String = "" 'Si es cancelacion de una refactura ignoramos las condiciones If Me.CveEstatus = 13 Then CancelarRefacturada() @@ -19495,11 +19498,9 @@ Partial Class Ventas Else If EsRefacturacion Then If resp.CveEstatus = 20 Then - ObjFacturaCancelacion.Dispose() - Server.Transfer($"/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={CveVenta}") + LigaRedirigir = $"/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={CveVenta}" ElseIf resp.CveEstatus.Contiene(4, 5) Then - ObjFacturaCancelacion.Dispose() - Server.Transfer($"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1") + LigaRedirigir = $"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1" Else Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();") End If @@ -19507,8 +19508,6 @@ Partial Class Ventas Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();") End If End If - - ObjFacturaCancelacion.CveAlmacen = -1 Else Alert("Ocurrió un error al generar la cancelación", TipoMensaje.MsgError) End If @@ -19520,6 +19519,10 @@ Partial Class Ventas UpEstatus.Update() + If Not String.IsNullOrEmpty(LigaRedirigir) Then + Response.Redirect(LigaRedirigir) + End If + End Sub From 352234d8bec1b370be8b9e293584e30b665b5c5d Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 30 May 2020 15:26:14 -0700 Subject: [PATCH 08/55] Cambio de uso de funcion de existencias a tabla de existencias en consulta de servicio web --- asmx/WSApp.asmx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 88b6270ad..e82b2fafa 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -633,7 +633,7 @@ Public Class WSApp Dim retorno As String = "[]" Dim CvePS = -1 Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPSExistencias(CvePS, CvePrecioLista, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then + If ObjPS.GetPSExistenciasWS(CvePS, CvePrecioLista, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then If CveClasificacion > 0 Then retorno = ObjPS.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion}").ToJson() Else From 28351c58e09a8a3e9d39a2dd041867fd325ea8b7 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 30 May 2020 15:33:13 -0700 Subject: [PATCH 09/55] -- se quito GlobalDTFolios --- App_Code/Modelos.vb | 8 -- Ashx/SIGFacturacion.ashx | 163 +++++++++++++--------------- Contratos/FacturacionMasiva.aspx.vb | 26 ++++- GPS/FacturacionMasiva.aspx.vb | 23 +++- Planeacion/CatFolios.aspx.vb | 6 +- Sistemas/CatSesiones.aspx | 3 +- Sistemas/CatSesiones.aspx.vb | 14 --- 7 files changed, 129 insertions(+), 114 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 4fae8a392..07f8fecbf 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6684,14 +6684,6 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value End Set End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(HttpContext.Current.Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFolios") = value - End Set - End Property Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable) diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index fa0c9409b..c1e46ead0 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -1,5 +1,5 @@ -<%@ WebHandler Language="VB" Class="SIGFacturacion" %> - +<%@ WebHandler Language="VB" Class="SIGFacturacion" %> + Imports System Imports System.Web Imports System.Net.Http @@ -212,8 +212,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState json.Add(New JProperty("Almacen", ObsInv.ToString())) Return json - End Function - + End Function + #Region "V A L I D A - D A T O S" Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario Dim UsuarioActual As Usuario = Nothing @@ -247,8 +247,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState UsuarioActual.Empresa = ObjEmpresa.Empresa End If ObjEmpresa.Dispose() - End Sub - + End Sub + #End Region #Region "D E F I N I R - O B J E T O S" Private Function CreaFactura(Resp As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DTRemisionesPS As DataTable, CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer, DatosRemisiones As JObject, FechaI As DateTime, FechaF As DateTime) As Modelos.Factura @@ -750,7 +750,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState 'RECARGAR GV Return Row - End Function + End Function #End Region #Region "E N V I O - C O R R E O" Private Sub EnviarCorreo(Objfactura As Modelos.Factura, UsuarioActual As Usuario) @@ -894,9 +894,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState End If End Try End If - End Sub + End Sub #End Region - + Public Sub GuardaLogFacturacion(Str As String) Dim ArchivoW As StreamWriter Dim strLineaTMP As String @@ -919,8 +919,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ArchivoW.Close() ArchivoW.Dispose() - End Sub - + End Sub + #Region "G L O B A L - D T" Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double Get @@ -1105,10 +1105,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTPSATPS") = value End Set - End Property - + End Property + #Region "GLOBALES DE SAT COMERCIO EXTERIOR" - + Property GlobalDTClavePedimento() As DataTable Get GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application("GlobalDTClavePedimento"), DataTable) @@ -1218,10 +1218,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTColonia") = value End Set - End Property - + End Property + #End Region - + Property GlobalDTPSATUM() As DataTable Get GlobalDTPSATUM = DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), DataTable) @@ -1605,15 +1605,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value End Set - End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(HttpContext.Current.Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFolios") = value - End Set - End Property + End Property + Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable) @@ -2354,9 +2347,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus") = value End Set - End Property - - + End Property + + #Region "***********************************************************************DT EVENTOS****************************************************************************************" Property GlobalDTTiposEventos() As DataTable Get @@ -2392,9 +2385,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOIEstatusEventos") = value End Set - End Property + End Property #End Region - + #Region " **********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable Get @@ -2435,9 +2428,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************" Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable Get @@ -2530,10 +2523,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoActivoFijo") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT GENERALES**************************************************************************************" Property GlobalDTGralPaises() As DataTable Get @@ -2621,10 +2614,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTGralColectivas") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable Get @@ -2833,8 +2826,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosTipos") = value End Set - End Property - + End Property + #Region " DT PROSPECTOS SOLICITUDES" Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable Get @@ -2901,15 +2894,15 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos") = value End Set - End Property - + End Property + #End Region #End Region - + #Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" - + #Region "***********************************************************************DT AMORTIZACIÓN CONTABLE*********************************************************************************************" - + Property GlobalDTAC_RubrosIngreso() As DataTable Get GlobalDTAC_RubrosIngreso = DirectCast(HttpContext.Current.Application("GlobalDTAC_RubrosIngreso"), DataTable) @@ -3165,11 +3158,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_MatrizEgresos") = value End Set - End Property - - + End Property + + #End Region - + Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3248,9 +3241,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_PD_Metas") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************" Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable Get @@ -3287,11 +3280,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value End Set - End Property - - + End Property + + #End Region - + #Region "F I N A N Z A S " Property GlobalDTFinan_RazonesFinancieras() As DataTable Get @@ -3300,10 +3293,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras") = value End Set - End Property + End Property #End Region - - + + #Region "***********************************************************************GLOBAL DT CONTABILIDAD****************************************************************************" Property GlobalDTContaPlantillasPolizas(CveEmpresa As Integer, Optional TipoPlantilla As Integer = -1) As DataTable Get @@ -3357,9 +3350,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTContaConceptosContables") = value End Set - End Property + End Property #End Region - + #Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************" Property GlobalDTAsistenciaDetalle() As DataTable Get @@ -3511,13 +3504,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoBuzon") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - C O M B U S T I B L E S ***********" - - - + + + Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3556,11 +3549,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(ByVal value As DataTable) HttpContext.Current.Application("GlobalDTCombustiblesTipos") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - M A N T E N I M I E N T O S ***********" - + Property GlobalDTMantenimientosTipos() As DataTable Get GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable) @@ -3599,13 +3592,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value End Set - End Property - + End Property + #End Region - - + + #Region "*********** D T - T A L L E R E S ***********" - + Property GlobalDTTalleresTipos() As DataTable Get GlobalDTTalleresTipos = DirectCast(HttpContext.Current.Application("GlobalDTTalleresTipos"), DataTable) @@ -3622,12 +3615,12 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTalleres") = value End Set - End Property - + End Property + #End Region - + #Region "*********** D T - D I S T R I B U I D O R E S ***********" - + Property GlobalDTDistribuidoresTipos() As DataTable Get GlobalDTDistribuidoresTipos = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidoresTipos"), DataTable) @@ -3644,11 +3637,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTDistribuidores") = value End Set - End Property - + End Property + #End Region - - + + Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3739,8 +3732,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTPaqueterias") = value End Set - End Property - + End Property + #End Region - + End Class \ No newline at end of file diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index 7155797ae..b005a874d 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -19,6 +19,15 @@ Partial Class Contratos_FacturacionMasiva ViewState("DTCicloComercial") = value End Set End Property + Private Property FolioVigentes As Boolean + Get + Return CType(ViewState("FolioVigentes"), Boolean) + End Get + Set(value As Boolean) + ViewState("FolioVigentes") = value + End Set + End Property + Private Property Mensaje As String Get Return CType(ViewState("Mensaje"), String) @@ -100,6 +109,7 @@ Partial Class Contratos_FacturacionMasiva Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + FolioVigentes = False CargaCombos() txtFechaI.Text = DateTime.Today.ToString("d") txtFechaF.Text = DateTime.Today.ToString("d") @@ -118,6 +128,8 @@ Partial Class Contratos_FacturacionMasiva DdlSucursal.DataBind() End Sub Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer) + ValidaFolio() + Dim ObjContratos As New ClsContratos If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0") @@ -127,9 +139,21 @@ Partial Class Contratos_FacturacionMasiva GvCiclosComerciales.DataBind() UpGv.Update() End Sub + + Private Sub ValidaFolio() + Dim ObjFolios As New ClsGralFolios + If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then + If ObjFolios.DtResultados.Rows.Count > 0 Then + FolioVigentes = True + End If + End If + + ObjFolios.Dispose() + End Sub Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then + '' Pendiente de aplicar validacion + If Not FolioVigentes Then e.Row.FCCheckBox("chkDis").Enabled = False e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios" End If diff --git a/GPS/FacturacionMasiva.aspx.vb b/GPS/FacturacionMasiva.aspx.vb index 5db90c87c..79ee47c03 100644 --- a/GPS/FacturacionMasiva.aspx.vb +++ b/GPS/FacturacionMasiva.aspx.vb @@ -27,6 +27,14 @@ Partial Class Contratos_FacturacionMasiva ViewState("Mensaje") = value End Set End Property + Private Property FolioVigentes As Boolean + Get + Return CType(ViewState("FolioVigentes"), Boolean) + End Get + Set(value As Boolean) + ViewState("FolioVigentes") = value + End Set + End Property Private Property ErrorList As List(Of String) Get Return CType(ViewState("ErrorList"), List(Of String)) @@ -79,6 +87,7 @@ Partial Class Contratos_FacturacionMasiva Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + FolioVigentes = False CargaCombos() txtFechaI.Text = DateTime.Today.ToString("d") txtFechaF.Text = DateTime.Today.ToString("d") @@ -97,6 +106,7 @@ Partial Class Contratos_FacturacionMasiva DdlSucursal.DataBind() End Sub Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer) + ValidaFolio() Dim ObjContratos As New ClsContratos If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0") @@ -106,9 +116,20 @@ Partial Class Contratos_FacturacionMasiva GvCiclosComerciales.DataBind() UpGv.Update() End Sub + + Private Sub ValidaFolio() + Dim ObjFolios As New ClsGralFolios + If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then + If ObjFolios.DtResultados.Rows.Count > 0 Then + FolioVigentes = True + End If + End If + + ObjFolios.Dispose() + End Sub Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then + If Not FolioVigentes Then e.Row.FCCheckBox("chkDis").Enabled = False e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios" End If diff --git a/Planeacion/CatFolios.aspx.vb b/Planeacion/CatFolios.aspx.vb index 5646a6ec2..5d7011078 100644 --- a/Planeacion/CatFolios.aspx.vb +++ b/Planeacion/CatFolios.aspx.vb @@ -91,7 +91,7 @@ Partial Class CatFolios Dim ObjFolios As New ClsGralFolios If ObjFolios.GetFolios() Then ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTFolios = ObjFolios.DtResultados + GvDatos.DataSource = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GvDatos.DataBind() Else @@ -153,7 +153,7 @@ Partial Class CatFolios If ObjFolios.RemoveFolios(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTFolios = ObjFolios.DtResultados + Alert("La Aprobación de Folios se eliminó correctamente.", TipoMensaje.MsgInformacion) End If ObjFolios.Dispose() @@ -194,7 +194,7 @@ Partial Class CatFolios Session("FileUpload") = "" Alert("La nueva Aprobación de Folios se guardó/editó correctamente.", TipoMensaje.MsgInformacion) - GlobalDTFolios = ObjFolios.DtResultados + ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) diff --git a/Sistemas/CatSesiones.aspx b/Sistemas/CatSesiones.aspx index a5e1ae906..266a9afff 100644 --- a/Sistemas/CatSesiones.aspx +++ b/Sistemas/CatSesiones.aspx @@ -20,8 +20,7 @@ - - + <%-- --%> diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 046bd3751..943e3b585 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -24,8 +24,6 @@ Partial Class Sistemas_CatSesiones CargaSubProyectos() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSubProyectosUsuarios" Then CargaSubProyectos() - ElseIf DdlVariable.SelectedItem.Value = "GlobalDTFolios" Then - CargaFolios() 'ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSucursales" Then ' CargaSucursales() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTCompProveedores" Then @@ -341,18 +339,6 @@ Partial Class Sistemas_CatSesiones 'Fin Carga Proyectos End Sub - Private Sub CargaFolios() - 'Carga Folios - Dim ObjFolios As New ClsGralFolios() - If ObjFolios.GetFolios() Then - Application("GlobalDTFolios") = ObjFolios.DtResultados - Else - Application("GlobalDTFolios") = Nothing - End If - ObjFolios.Dispose() - 'Fin Carga Folios - End Sub - 'Private Sub CargaSucursales() ' 'Carga Sucursales ' Dim ObjSucursales As New ClsSucursales() From 3e7a5e0392d74ee70811bfd19d9aed6aaeb65025 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 1 Jun 2020 01:21:30 -0700 Subject: [PATCH 10/55] --- App_Code/ClsNominas.vb | 21 ++- App_Code/ClsRH.vb | 30 ++++- Nomina/Nomina.aspx.vb | 2 +- Nomina/Nomina2.aspx | 105 ++++++++++++--- Nomina/Nomina2.aspx.cs | 165 +++++++++++++++++------ OI/CircularDetalleB.aspx.cs | 16 ++- OI/ConvocatoriaDetalle.aspx | 6 +- OI/ConvocatoriaDetalle.aspx.cs | 55 ++++++-- OI/MinutaDetalle.aspx.cs | 2 +- OI/RepReuniones.aspx | 4 +- OI/RepReuniones.aspx.cs | 6 +- OI/TareaDetalle.aspx | 16 +-- OI/TareaDetalle.aspx.cs | 4 +- RH/Asistencias.aspx | 238 ++++++++++++++++++--------------- RH/Asistencias.aspx.vb | 3 +- vwd.webinfo | 4 + 16 files changed, 466 insertions(+), 211 deletions(-) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 586bd8874..54ee9c7b4 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -522,10 +522,28 @@ Public Class ClsNominas Return Retorno End Function + Public Function AutorizaNom_Nominas(CvePersonal As Integer, CvePeriodo As Integer, Optional Autorizado As Boolean = True) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Nom_Nominas_Autoriza") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al autorizar la nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function AddNom_Nominas(FolioNom As Integer, CveNominaTipo As Integer, CvePersonal As Integer, CvePeriodo As Integer, SubTotal As Double, Descuento As Double, RetISR As Double, Total As Double, CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, Fecha As Date, MotivoDescuento As String, Observaciones As String, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double, - Fech1 As Date, Fech2 As Date, Fech3 As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Fech1 As Date, Fech2 As Date, Fech3 As Date, CveUsuario As Integer, CveEmpresa As Integer, Optional Autorizado As Boolean = True) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_NominasAdd") @@ -555,6 +573,7 @@ Public Class ClsNominas .Add("@Fech3", SqlDbType.VarChar).Value = IIf(Fech3.ToString = "01/01/0001 12:00:00 a.m.", "-1", Fech3.ToString) .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With 'SqlTypes.SqlDateTime.Null diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 2d5c46f6a..09d4cb16a 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2288,10 +2288,36 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function + End Function + + Public Function AddAsistenciaMasiva2(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + Data = New DataTable + SqlDataAdapter("PA_RH_PersonalAsistenciasMasivaAddUpd2") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya se registró la Asistencia para el empleado.", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar la Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function #End Region - + #Region "Asistencias Detalles" Public Function GetAsistenciasDetalle() As Boolean Dim Retorno As Boolean = False diff --git a/Nomina/Nomina.aspx.vb b/Nomina/Nomina.aspx.vb index 86a6aea16..5fca491c5 100644 --- a/Nomina/Nomina.aspx.vb +++ b/Nomina/Nomina.aspx.vb @@ -229,7 +229,7 @@ Partial Class Nomina_Nomina Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then - If UsuarioActual.CveEmpresa = 80 OrElse UsuarioActual.CveEmpresa = 72 Then + If UsuarioActual.CveEmpresa = 80 OrElse UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 119 Then Response.Redirect("/Nomina/Nomina2.aspx") End If CargaTiposPeriodo() diff --git a/Nomina/Nomina2.aspx b/Nomina/Nomina2.aspx index 56dc52083..7ce1b7f3d 100644 --- a/Nomina/Nomina2.aspx +++ b/Nomina/Nomina2.aspx @@ -4,9 +4,10 @@ - - - CP Benjamin Carrillo Cota - HTML - - CP Sara Eduwiges Ruíz Félix HTML @@ -1969,9 +1945,10 @@ AgrupadoPor - 16.31254cm + 16.94754cm + 14.51918cm 0.6cm - 561.96737pt + 139.98364pt 15 + + true + true + + + + + =Parameters!Filtros.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CP. Daniel Hernández Tapia + HTML + + + + Textbox47 + 16.94754cm + 0.47837cm + 0.6cm + 5.38396cm + 22 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CP Benjamin Carrillo Cota + HTML + + + + Textbox48 + 16.94754cm + 7.96078cm + 0.6cm + 4.88125cm + 23 + + + 2pt + 2pt + 2pt + 2pt + + - 6.6828in + 6.95328in - <%--Paqueterías Guías--%>Entrega Interna + Entregas por Realizar +
  • + PDF +
  • +
    @@ -70,9 +74,10 @@   + -   +   diff --git a/Inventarios/EntregasPorRealizar.aspx.cs b/Inventarios/EntregasPorRealizar.aspx.cs index bf831e4e3..4ccde9706 100644 --- a/Inventarios/EntregasPorRealizar.aspx.cs +++ b/Inventarios/EntregasPorRealizar.aspx.cs @@ -76,4 +76,27 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas DdlUsuario.DataBind(); DdlUsuario.Items.Insert(0, new ListItem("Seleccione", "-1")); } + + private void ImprimirPDF() + { + + // params As New List(Of ReportParameter); + + //params.Add(New ReportParameter("Fecha", FechaI)); + //params.Add(New ReportParameter("AsignadoA", "")); + //params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + + ////If Imagen.Exists Then + //// params.Add(New ReportParameter("LogoPath", logouri)) + ////Else + //// params.Add(New ReportParameter("LogoPath", "")) + ////End If + //ImprimirPDF("Empresas/Grales/Formatos/RepVentas.rdlc", dt, params, String.Format("EntregasAsignadas-{0}", Now.ToDateTime.ToShortDateString), Formato:= "PDF") + + } + + protected void LnkImprimir_Click(object sender, EventArgs e) + { + ImprimirPDF(); + } } \ No newline at end of file diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 54ec0779b..3d075a75a 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -200,6 +200,10 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End Sub #End Region + Protected Sub BtnSerie_Click(sender As Object, e As EventArgs) + + End Sub + #Region " PROCESAR - VERIFICAR EXISTENCIAS " Protected Sub BtnVerificarExistenciasArmado_Click(sender As Object, e As EventArgs) TipoMovimiento = 1 diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index 05c36bef0..a543fe7b5 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -208,7 +208,7 @@ Clasificación
    Producto U.M. - Serie - Lote + Serie Observaciones diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index f6173c7ed..debb185dc 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -787,7 +787,7 @@ Partial Class Inventarios_ResguardoMaterial Dim Cont As Integer = 0 For Each Gvr As GridViewRow In GvMLiberacion.Rows If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("SerieLote").ToString, Gvr.DataKey("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Gvr.DataKey("Observaciones").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For @@ -809,7 +809,7 @@ Partial Class Inventarios_ResguardoMaterial If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Cont = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" Exit For diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 97b534794..f942b9039 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -3288,7 +3288,7 @@ - Correo Notificaciones:  + Correo Notificacion:  diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 296643417..4928b7d97 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3938,6 +3938,8 @@ Partial Class Ventas TxtSubTotal2.Text = (TxtSubTotal.Text.Replace(",", "").Trim.Trim.ToDouble - LblDescuentos.Text.Replace(",", "").Trim.Trim.ToDouble - LblAmortizacion.Text.Replace(",", "").Trim.Trim.ToDouble).FormatoNumero(2) TxtIVA.Text = DbRowVenta("IVA").ToString().FormatoNumero(2) TxtRetIVA.Text = DbRowVenta("RetIVA").ToString().FormatoNumero(2) + TxtCorreoNotificaciones.Text = DbRowVenta("CorreoNotificacion").ToString() + If TxtRetIVA.Text.ToDecimal() > 0 Then TrRetIVA.Style.Add("display", "") UsuarioActual.Empresa.MostrarRetIVA = True From b2b0700e63dfecefa4dbd2344c63a7dc6a3532fc Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 3 Jun 2020 15:45:28 -0700 Subject: [PATCH 29/55] reporte de entregas por realizar, adelanto --- Inventarios/EntregasPorRealizar.aspx | 10 ++++++++++ Inventarios/EntregasPorRealizar.aspx.cs | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Inventarios/EntregasPorRealizar.aspx b/Inventarios/EntregasPorRealizar.aspx index 9b5943b7e..b188753b0 100644 --- a/Inventarios/EntregasPorRealizar.aspx +++ b/Inventarios/EntregasPorRealizar.aspx @@ -20,6 +20,16 @@ + + +
  • + +
  • +
    + + + +
    diff --git a/Inventarios/EntregasPorRealizar.aspx.cs b/Inventarios/EntregasPorRealizar.aspx.cs index bf831e4e3..47ab0e863 100644 --- a/Inventarios/EntregasPorRealizar.aspx.cs +++ b/Inventarios/EntregasPorRealizar.aspx.cs @@ -6,9 +6,22 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using Extensiones; +using Microsoft.Reporting.WebForms; public partial class Inventarios_EntregasPorRealizar : ClsPaginas { + private DataTable DtPaqueteriasGuias + { + get + { + return (ViewState["DtPaqueteriasGuias"] == null) ? null : (DataTable)ViewState["DtPaqueteriasGuias"]; + } + set + { + ViewState["DtPaqueteriasGuias"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -65,6 +78,7 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas if (ObjGeneral.GetEntregasPorRealizar(UsuarioActual.CveEmpresa)) { GvPaqueteriasGuias.DataSource = ObjGeneral.DtResultados; + DtPaqueteriasGuias = ObjGeneral.DtResultados; GvPaqueteriasGuias.DataBind(); } ObjGeneral.Dispose(); @@ -76,4 +90,15 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas DdlUsuario.DataBind(); DdlUsuario.Items.Insert(0, new ListItem("Seleccione", "-1")); } + + protected void LnkImprimir_Click(object sender, EventArgs e) + { + List RepParams = new List(); + string Usuario = DdlUsuario.SelectedValue.ToEntero() > 0 ? DdlUsuario.SelectedItem.Text : "Todos"; + RepParams.Add(new ReportParameter("Fecha", DateTime.Today.ToString())); + RepParams.Add(new ReportParameter("AsignadoA", Usuario)); + RepParams.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + + ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF",RDSName:"DsInventarios"); + } } \ No newline at end of file From 1e5f7692b7416100158157f32ff9fe26d2960ce5 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 3 Jun 2020 15:53:31 -0700 Subject: [PATCH 30/55] agregando reporte al git --- Empresas/72/Formatos/EntregasPorRealizar.rdlc | 1247 +++++++++++++++++ 1 file changed, 1247 insertions(+) create mode 100644 Empresas/72/Formatos/EntregasPorRealizar.rdlc diff --git a/Empresas/72/Formatos/EntregasPorRealizar.rdlc b/Empresas/72/Formatos/EntregasPorRealizar.rdlc new file mode 100644 index 000000000..2515ccda8 --- /dev/null +++ b/Empresas/72/Formatos/EntregasPorRealizar.rdlc @@ -0,0 +1,1247 @@ + + + + + + + + + 1.7517cm + + + 2.58124cm + + + 4.16973cm + + + 6.00193cm + + + 5.79019cm + + + + + 0.51314cm + + + + + true + true + + + + + Numero + + + + + + + Textbox8 + + + + + + + + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Folio + + + + + + + Textbox1 + + + + + + + + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Fecha + + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Nombre + + + + + + + + + + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Contacto + + + + + + + Textbox5 + + + + Black + + 1pt + + + Black + + 1pt + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.4095cm + + + + + true + true + + + + + =Fields!Num.Value + + + + + + + Num + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!serieFolio.Value + + + + + + + serieFolio + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!fecha.Value + + + + + + + fecha + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!nombre.Value + + + + + + + nombre + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + true + + + + + =Fields!contacto.Value + + + + + + + contacto + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsInventarios + 0.07056cm + 0.03488cm + 0.92264cm + 20.29479cm + + + + + + true + true + + + + + Recibido por: + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 1.22221in + + + + + + + Textbox2 + 0.19477cm + 2.55499cm + 1.1027cm + 15.46868cm + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 0.07668in + 0cm + 0.86392in + 1.0059in + 1 + + + + + + true + true + + + + + ENTREGAS POR REALIZAR + + + + + + + Textbox4 + 1.40331cm + 7.12631cm + 0.98582cm + 6.32604cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha: + + + + + + + + =Parameters!Fecha.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Asignado a: + + + + + + + + =Parameters!AsignadoA.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.87489cm + true + true + + + true + true + + + + + Usuario: + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + =Now + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.24341cm + 17.71971cm + 0.41981cm + 2.5cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.06702cm + 0.05952cm + 0cm + 20.27015cm + 3 + + + + + + + + + + 25cm + 21.59cm + 0.5cm + 0.5cm + 0.5cm + 0.5cm + 0.13cm + @@ -361,7 +366,10 @@ Estatus:
    - + +
    + % +
    Avance: @@ -371,7 +379,7 @@
    - +
    @@ -744,15 +752,20 @@ Agregar relación