From b4efd109175b46a84dcedbde3040079528151594 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Thu, 29 May 2025 11:15:08 -0700 Subject: [PATCH] =?UTF-8?q?RepOC=20ajuste=20unificar=20conulsta=20de=20alm?= =?UTF-8?q?ac=C3=A9n=20comprado=20recibido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsOC.vb | 51 ----------------------------------------------- OC/RepOC.aspx.vb | 38 ++++++++++------------------------- 2 files changed, 10 insertions(+), 79 deletions(-) diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index dc09b7dbc..e7b81ca0c 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1726,57 +1726,6 @@ Public Class ClsOC Return Retorno End Function - Public Function GetOrdenesCompraCompradosRecibidosRep(Tipo As String, CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveEstatus As Integer, FechaInicio As Date, - FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer, - CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", - Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, - Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1, - Optional MetodoPago As Integer = -1, Optional Serie As String = "-1", Optional TieneAnticipo As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_OC_OrdenesCompraCompradosRecibidosRep") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Tipo", SqlDbType.VarChar).Value = Tipo - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus - .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra - .Add("@CveUsuarioRegistro", SqlDbType.Int).Value = CveUsuarioRegistro - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Folio", SqlDbType.Int).Value = Folio - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@PendientePorSurtir", SqlDbType.Bit).Value = PendientePorSurtir - .Add("@Guia", SqlDbType.VarChar).Value = Guia - .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo - .Add("@SoloSubProyectosConPermiso", SqlDbType.Bit).Value = SoloSubProyectosConPermiso - .Add("@CveUsuarioAutorizo", SqlDbType.Int).Value = CveUsuarioAutorizo - .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado - .Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta - .Add("@TopSelect", SqlDbType.Int).Value = TopSelect - .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda - .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago - .Add("@Serie", SqlDbType.VarChar).Value = Serie - .Add("@TieneAnticipo", SqlDbType.Int).Value = TieneAnticipo - End With - - Try - SqlAdapter.Fill(Data) - - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener Ordenes de Compras Comprados Recividos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetOrdenesCompraRepReqXOC(Folio As Integer, FechaInicio As String, FechaFin As String, CveProveedor As Integer, CveVendedor As Integer, CveCliente As Integer, CveEmpresa As Integer, Grupo As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/OC/RepOC.aspx.vb b/OC/RepOC.aspx.vb index 8aea87ede..0136764eb 100644 --- a/OC/RepOC.aspx.vb +++ b/OC/RepOC.aspx.vb @@ -407,6 +407,16 @@ Partial Class RepOC MuestraIndicador(DivIndicadores, "green-haze", "fa fa-money", "Órdenes de Compra", Cantidad.ToString, "Cantidad", "$" + Total.FormatoNumero, "Total", "$" + TotalPesos.FormatoNumero, "Pesos", "$" + TotalDolares.FormatoNumero, "Dólares") UPPIndicador.Update() + + DivIndicadoresCompradoRecibido.Visible = True + DivIndicadoresCompradoRecibido.InnerHtml = String.Empty + + Dim Recibidos As Decimal = DtOC.SUM("Comprado") + Dim Comprados As Decimal = DtOC.SUM("Recibido") + + MuestraIndicadorCompradoRecibido(DivIndicadoresCompradoRecibido, "blue", "fa fa-truck", "Almacén", Recibidos.ToString("###,###,###.00"), "Comprados", "", "Recibidos", Comprados.ToString("###,###,###.00"), "") + UPPIndicadorCompradoRecibido.Update() + End If If DtOC IsNot Nothing AndAlso DtOC.Rows.Count > 0 Then @@ -435,35 +445,7 @@ Partial Class RepOC End If - If UsuarioActual.TienePermisoProceso(227) And UsuarioActual.CveRol = 1 Then - DivIndicadoresCompradoRecibido.Visible = True - DivIndicadoresCompradoRecibido.InnerHtml = String.Empty - - - If OC.GetOrdenesCompraCompradosRecibidosRep(DdlTipo.SelectedValue.ToString, DdlProyectos.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, - DdlEstatus.SelectedValue.ToEntero, FI, FF, -1, DdlProveedores.SelectedValue.ToEntero, If(txtFolio.Text.ToEntero = 0, -1, txtFolio.Text.ToEntero), ddlUsuario.SelectedValue.ToEntero, - UsuarioActual.CveUsuario, UsuarioActual.Empresa.CveEmpresa, If(DDlPS.SelectedValue = "", -1, DDlPS.SelectedValue.ToEntero), False, - ddlclientes.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), - CveUsuarioAutorizo:=DdlUsuarioAutorizo.SelectedValue.ToEntero(), CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(), - CveMoneda:=DdlMoneda.SelectedValue.ToEntero(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero, TieneAnticipo:=DdlTieneAnticipo.SelectedValue.ToEntero) Then - - Dim Recibidos As Decimal = 0D - Dim Comprados As Decimal = 0D - - If OC.DtResultados.Rows.Count > 0 Then - Recibidos = OC.DtResultados.Rows(0)("Comprado").ToString.ToDecimal - Comprados = OC.DtResultados.Rows(0)("Recibido").ToString.ToDecimal - End If - - MuestraIndicadorCompradoRecibido(DivIndicadoresCompradoRecibido, "blue", "fa fa-truck", "Almacén", Recibidos.ToString("###,###,###.00"), "Comprados", "", "Recibidos", Comprados.ToString("###,###,###.00"), "") - - End If - - UPPIndicadorCompradoRecibido.Update() - - - End If End If OC.Dispose()