From 385f90ecca7bfa965ea0eefd5da6f8a5f44fc044 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Thu, 5 Nov 2020 17:43:39 -0700 Subject: [PATCH] Reportes contratos --- App_Code/ClsContratos.vb | 88 +++++++++ App_Code/ClsPaginas.vb | 7 +- Contratos/RepContratosObraAvances.aspx | 169 +++++++++++++++++ Contratos/RepContratosObraAvances.aspx.vb | 75 ++++++++ Contratos/RepContratosObraAvancesDetalle.aspx | 175 ++++++++++++++++++ .../RepContratosObraAvancesDetalle.aspx.vb | 95 ++++++++++ ...px => RepContratosObraAvancesPartida.aspx} | 125 ++++++++----- .../RepContratosObraAvancesPartida.aspx.vb | 71 +++++++ 8 files changed, 755 insertions(+), 50 deletions(-) create mode 100644 Contratos/RepContratosObraAvances.aspx create mode 100644 Contratos/RepContratosObraAvances.aspx.vb create mode 100644 Contratos/RepContratosObraAvancesDetalle.aspx create mode 100644 Contratos/RepContratosObraAvancesDetalle.aspx.vb rename Contratos/{RepContratosAvances.aspx => RepContratosObraAvancesPartida.aspx} (54%) create mode 100644 Contratos/RepContratosObraAvancesPartida.aspx.vb diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 88cfc8e83..5b3539533 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -687,6 +687,94 @@ Public Class ClsContratos #End Region +#Region "ESTIMACION OBRA" + + Public Function GetContratosObraRepAvances(FechaI As Date, FechaF As Date, CveCliente As Integer, CveContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraRepAvancesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar el avance de contratos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function GetContratosObraRepAvancesDetalle(CveContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraRepAvancesDetalleGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar el detalle del avance.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function GetContratosObraRepAvancesPartida(CveEstimacion As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraRepAvancesPartidaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar las partidas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetContratosObraRepAvancesPartida(FechaI As Date, FechaF As Date, CveCliente As Integer, CveContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraRepAvancesPartidaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar el avance de partida.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + #Region "C I C L O C O M E R C I A L" Public Function CicloComercialAdd(CveContrato As Integer, CveCotizacion As Integer, CveCliente As Integer, FueFacturado As Boolean, CveFactura As Integer, Estatus As Integer, CveEmpresa As Integer, FechaVenc As Date) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 82bb1cb39..18fa76558 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4981,13 +4981,12 @@ Public Class ClsPaginas PaginaDict.Add("/PV/PVRepVentasCompras.aspx".ToUpper(), 273) PaginaDict.Add("/Contratos/ContratoObra.aspx".ToUpper(), -1) - - - + PaginaDict.Add("/Contratos/RepContratosObraAvances.aspx".ToUpper(), -1) + PaginaDict.Add("/Contratos/RepContratosObraAvancesDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/Contratos/RepContratosObraAvancesPartida.aspx".ToUpper(), -1) 'Orden Produccion' - 'RMA PaginaDict.Add("/RMA/Garantias.aspx".ToUpper(), 175) diff --git a/Contratos/RepContratosObraAvances.aspx b/Contratos/RepContratosObraAvances.aspx new file mode 100644 index 000000000..6d112bbfd --- /dev/null +++ b/Contratos/RepContratosObraAvances.aspx @@ -0,0 +1,169 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosObraAvances.aspx.vb" Inherits="RepContratosObraAvances" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Reporte Contratos Avance + + + + + + + + + +
+
+ +
+ +
+ +
+
+ +
+ Fecha Inicio: +
+
+
+ + + + +
+ + + + + + + + +
+ + +
+ Fecha Fin: +
+
+
+ + + + +
+ + + + + + +
+ +
+ Cliente: +
+
+ +
+ +
+ Contrato: +
+
+ +
+ + +
+ +
+ +
+
+ +
+
+ + + + + +
+ +
+
+ " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" /> + " class="btn btn-circle btn-sm label-info"> +
+ +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+ + + diff --git a/Contratos/RepContratosObraAvances.aspx.vb b/Contratos/RepContratosObraAvances.aspx.vb new file mode 100644 index 000000000..354b94859 --- /dev/null +++ b/Contratos/RepContratosObraAvances.aspx.vb @@ -0,0 +1,75 @@ +Imports Extensiones +Imports System.Data + +Partial Class RepContratosObraAvances + Inherits ClsPaginas + + + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + CargaClientes() + CargaContratos() + 'CargaDatos() + + End If + End Sub + + + Private Sub CargaDatos() + + Dim Con As New ClsContratos + + If Con.GetContratosObraRepAvances(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, DdlContrato.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GVDatos.DataSource = Con.DtResultados + Else + GVDatos.DataSource = Nothing + End If + + Con.Dispose() + + GVDatos.DataBind() + UpDatos.Update() + + End Sub + +#Region "C O M B O S" + + + Private Sub CargaContratos() + DdlContrato.DataSource = GlobalDTContratos.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveContratoTipo IN(30,31) ") + DdlContrato.DataBind() + DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1")) + End Sub + + Private Sub CargaClientes() + Dim dt As DataTable = Nothing + Dim Cli As New ClsClientes + If Cli.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + dt = Cli.DtResultados + End If + Cli.Dispose() + DdlCliente.DataSource = dt + DdlCliente.DataBind() + DdlCliente.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + +#End Region + + Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVDatos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + End If + + End Sub + + Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + + + + +End Class diff --git a/Contratos/RepContratosObraAvancesDetalle.aspx b/Contratos/RepContratosObraAvancesDetalle.aspx new file mode 100644 index 000000000..793e02781 --- /dev/null +++ b/Contratos/RepContratosObraAvancesDetalle.aspx @@ -0,0 +1,175 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosObraAvancesDetalle.aspx.vb" Inherits="RepContratosObraAvancesDetalle" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Reporte Contratos Avance Detalle + + + + + +<%-- + + + +
+
+ +
+ +
+ +
+
+ +
+ Fecha Inicio: +
+
+
+ + + + +
+ + + + + + + + +
+ + +
+ Fecha Fin: +
+
+
+ + + + +
+ + + + + + +
+ +
+ Cliente: +
+
+ +
+ +
+ Contrato: +
+
+ +
+ + +
+ +
+ +
+
+ +
+
--%> + + + + + + +
+ +
+
+ " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" /> + " class="btn btn-circle btn-sm label-info"> +
+ +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+
+
+ + + diff --git a/Contratos/RepContratosObraAvancesDetalle.aspx.vb b/Contratos/RepContratosObraAvancesDetalle.aspx.vb new file mode 100644 index 000000000..92000aff3 --- /dev/null +++ b/Contratos/RepContratosObraAvancesDetalle.aspx.vb @@ -0,0 +1,95 @@ +Imports Extensiones +Imports System.Data + +Partial Class RepContratosObraAvancesDetalle + Inherits ClsPaginas + + + Property CveContrato As Integer + + Get + If ViewState("CveContrato") Is Nothing Then + Return -1 + Else + Return ViewState("CveContrato").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveContrato") = value + End Set + + + End Property + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + + CveContrato = If(Request("CveContrato") IsNot Nothing AndAlso Request("CveContrato").ToString.ToEntero > 0, Request("CveContrato").ToString.ToEntero, -1) + + If CveContrato > 0 Then + CargaDatos() + End If + End If + End Sub + + + Private Sub CargaDatos() + + Dim Con As New ClsContratos + + If Con.GetContratosObraRepAvancesDetalle(CveContrato, UsuarioActual.CveEmpresa) Then + GVDatos.DataSource = Con.DtResultados + + If Con.DtResultados.Rows.Count = 0 Then + Alert("No se encontraron estimaciones.", TipoMensaje.MsgAdvertencia) + End If + Else + GVDatos.DataSource = Nothing + + End If + + Con.Dispose() + + GVDatos.DataBind() + UpDatos.Update() + + End Sub + + '#Region "C O M B O S" + + + ' Private Sub CargaContratos() + ' DdlContrato.DataSource = GlobalDTContratos.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveContratoTipo IN(30,31) ") + ' DdlContrato.DataBind() + ' DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1")) + ' End Sub + + ' Private Sub CargaClientes() + ' Dim dt As DataTable = Nothing + ' Dim Cli As New ClsClientes + ' If Cli.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + ' dt = Cli.DtResultados + ' End If + ' Cli.Dispose() + ' DdlCliente.DataSource = dt + ' DdlCliente.DataBind() + ' DdlCliente.Items.Insert(0, New ListItem("Todos", "-1")) + ' End Sub + + '#End Region + + Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVDatos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + End If + + End Sub + + 'Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + ' CargaDatos() + 'End Sub + + +End Class \ No newline at end of file diff --git a/Contratos/RepContratosAvances.aspx b/Contratos/RepContratosObraAvancesPartida.aspx similarity index 54% rename from Contratos/RepContratosAvances.aspx rename to Contratos/RepContratosObraAvancesPartida.aspx index cbc3d6769..4b4fdded7 100644 --- a/Contratos/RepContratosAvances.aspx +++ b/Contratos/RepContratosObraAvancesPartida.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosAvances.aspx.vb" Inherits="RepContratosAvances" %> +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosObraAvancesPartida.aspx.vb" Inherits="RepContratosObraAvancesPartida" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> @@ -8,12 +8,14 @@ - Reporte de Contratos + Reporte Contratos Avance por partida - + + +<%--
@@ -44,80 +46,111 @@
-
+
--%> + - - - - - - - - - - - - -
# - - - - - -
- + + +
+ +
+
+ " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" /> + " class="btn btn-circle btn-sm label-info"> +
+ +
+
+ + + +
+
+ + - + - + - + + - - - - - - + - + + - + - + + - + - + + - + - + + <%-- - + + + + + + + + + + + + + + + + + + - - - - - + + + + + + --%> + + + + +
+
+
+ + + +
diff --git a/Contratos/RepContratosObraAvancesPartida.aspx.vb b/Contratos/RepContratosObraAvancesPartida.aspx.vb new file mode 100644 index 000000000..98e7cab37 --- /dev/null +++ b/Contratos/RepContratosObraAvancesPartida.aspx.vb @@ -0,0 +1,71 @@ +Imports Extensiones +Imports System.Data + +Partial Class RepContratosObraAvancesPartida + Inherits ClsPaginas + + + + Property CveEstimacion As Integer + + Get + If ViewState("CveEstimacion") Is Nothing Then + Return -1 + Else + Return ViewState("CveEstimacion").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveEstimacion") = value + End Set + + + End Property + + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + + CveEstimacion = If(Request("CveEstimacion") IsNot Nothing AndAlso Request("CveEstimacion").ToString.ToEntero > 0, Request("CveEstimacion").ToString.ToEntero, -1) + + If CveEstimacion > 0 Then + CargaDatos() + End If + End If + End Sub + + + Private Sub CargaDatos() + + Dim Con As New ClsContratos + + If Con.GetContratosObraRepAvancesPartida(CveEstimacion, UsuarioActual.CveEmpresa) Then + GVDatos.DataSource = Con.DtResultados + + If Con.DtResultados.Rows.Count = 0 Then + Alert("No se encontraron partidas.", TipoMensaje.MsgAdvertencia) + End If + Else + GVDatos.DataSource = Nothing + End If + + Con.Dispose() + + GVDatos.DataBind() + UpDatos.Update() + + End Sub + + + + Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVDatos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + End If + + End Sub + + +End Class