diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 8540c06cf..747f593bd 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -3096,7 +3096,7 @@ Public Class ClsContratos Return Retorno End Function - Public Function GetPresupuestosMensualRep(CvePresupuesto As Integer, CveTipoGasto As Integer, Agrupador As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveUsuarioConsulta As Integer, CveClasificacion As Integer) As Boolean + Public Function GetPresupuestosMensualRep(CvePresupuesto As Integer, CveTipoGasto As Integer, Agrupador As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveUsuarioConsulta As Integer, CveAgrupador As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosMensualRep") @@ -3110,7 +3110,7 @@ Public Class ClsContratos .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveAgrupador", SqlDbType.Int).Value = CveAgrupador End With Try @@ -3122,69 +3122,14 @@ Public Class ClsContratos Return Retorno End Function - - Public Function GetPresupuestosRepDetalle(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, Agrupador As Integer, Gpo As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer, Optional CveConceptoContableNom As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Con_PresupuestosRepDetalle") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveConceptoContableNom", SqlDbType.Int).Value = CveConceptoContableNom - .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto - .Add("@Agrupador", SqlDbType.Int).Value = Agrupador - .Add("@Gpo", SqlDbType.Int).Value = Gpo - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte detallado de presupuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetPresupuestosMensualRepDetalle(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, Agrupador As Integer, Gpo As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Con_PresupuestosMensualRepDetalle") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto - .Add("@Agrupador", SqlDbType.Int).Value = Agrupador - .Add("@Gpo", SqlDbType.Int).Value = Gpo - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte detallado de presupuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean + Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveAgrupador As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosRepDetalleCompra") With SqlAdapter.SelectCommand.Parameters .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveAgrupador", SqlDbType.Int).Value = CveAgrupador .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx b/Contratos/RepPresupuestosDetalleCompras.aspx index 1b611900f..a6f50fb94 100644 --- a/Contratos/RepPresupuestosDetalleCompras.aspx +++ b/Contratos/RepPresupuestosDetalleCompras.aspx @@ -221,7 +221,7 @@
Clasificacion:
- +
Tipo Gasto:
@@ -242,7 +242,7 @@
- + diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx.vb b/Contratos/RepPresupuestosDetalleCompras.aspx.vb index 56c455d1d..89ac7a195 100644 --- a/Contratos/RepPresupuestosDetalleCompras.aspx.vb +++ b/Contratos/RepPresupuestosDetalleCompras.aspx.vb @@ -31,11 +31,16 @@ Partial Class Contratos_RepPresupuestosDetalleCompras Private Sub InicializaValores() TxtFiltrosFechaInicio.Text = $"01/09/{Now.Year - 1}" - TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}" - - DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}" + + Dim dtAgrupador = (From dr In GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + Select New With {.CveAgrupador = dr("CveClasificacion").ToString().ToEntero(), .Agrupador = dr("Clasificacion").ToString()} + ).Union(From dr In GlobalDTContaConceptosContables(-1) + Select New With {.CveAgrupador = dr("CveConceptoContable").ToString().ToEntero(), .Agrupador = dr("ConceptoContable").ToString()}).QueryToDataTable(True) + + DdlClasificacion.DataSource = dtAgrupador + DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1")) - DdlClasificacion.DataBind() DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() @@ -121,6 +126,21 @@ Partial Class Contratos_RepPresupuestosDetalleCompras If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowIndex = 0 Then e.Row.CssClass = "Totales" + End If + If e.Row.RowIndex > 0 Then + Dim Liga = "" + Dim Css = "Texto" + + Dim TipoAgrupador As Integer = e.Row.DBCampo("TipoAgrupador").ToEntero() + Select Case TipoAgrupador + Case 1 + Liga = $"/Compras/Compras.aspx?&CveCompra={e.Row.DBCampo("CveCompra")}" + Case 2 + Liga = $"/Contabilidad/RegPrePoliza.aspx?&CvePrePoliza={e.Row.DBCampo("CveCompra")}" + Case Else + + End Select + e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If End If End Sub