This commit is contained in:
2023-04-22 06:41:34 -07:00
3 changed files with 30 additions and 65 deletions

View File

@@ -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

View File

@@ -221,7 +221,7 @@
<div class="col-md-1" style="max-width: 120px">Clasificacion:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlClasificacion" DataTextField="Clasificacion" AppendDataBoundItems="true" DataValueField="CveClasificacion" Width="200px" runat="server" CssClass="form-control input-sm select2me">
<asp:DropDownList ID="DdlClasificacion" DataTextField="Agrupador" AppendDataBoundItems="true" DataValueField="CveAgrupador" Width="200px" runat="server" CssClass="form-control input-sm select2me">
</asp:DropDownList>
</div>
<div class="col-md-1" style="max-width: 120px">Tipo Gasto:</div>
@@ -242,7 +242,7 @@
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvDatos_RowDataBound" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
<Columns>
<asp:HyperLinkField HeaderText="Serie - Folio" DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Serie - Folio" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Proveedor" DataField="RazonSocial" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />

View File

@@ -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 = "<a target=""_blank"" class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells(0).Text + "</a>"
End If
End If
End Sub