diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 22f47b871..7482500e9 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -197,7 +197,12 @@ Public Class ClsContratos #End Region #Region " C O N T R A T O S " - Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveCliente As Integer, Optional CveEstatus As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveTipoContrato As Integer = -1) As Boolean + Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveCliente As Integer, + Optional CveEstatus As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, + Optional CveTipoContrato As Integer = -1, + Optional FechaInicioIngreso As DateTime = MinFecha, + Optional FechaFinIngreso As DateTime = MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosReporteGet") @@ -210,7 +215,9 @@ Public Class ClsContratos .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF .Add("@CveChofer", SqlDbType.Int).Value = CveChofer .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicioIngreso", SqlDbType.DateTime).Value = FechaInicioIngreso + .Add("@FechaFinIngreso", SqlDbType.DateTime).Value = FechaFinIngreso End With Try SqlAdapter.Fill(Data) diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index a697ff570..102bcd838 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -418,10 +418,7 @@ Partial Class RepContratoDetalle ErrorProceso = True End If - - If Not ErrorProceso Then - If CveVentaRemision > 0 AndAlso (CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero OrElse CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero OrElse ImporteOrigial <> TxtImporte.Text.ToDecimal OrElse @@ -434,8 +431,6 @@ Partial Class RepContratoDetalle ErrorProceso = True End If End If - - End If If Not ErrorProceso Then @@ -445,15 +440,11 @@ Partial Class RepContratoDetalle AgregarABitacora($"Actualización del contrato {CveContrato}") CargaDatos() Alert("Contrato actualizado correctamente") - Else - Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError) ObjContratos.RollBack() - End If - End Sub Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index dea02f48c..b745538a5 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -24,7 +24,7 @@ Partial Class ListadoContratos If Not IsPostBack Then txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString - txtFechaF.Text = DateTime.Now.AddDays(15).ToShortDateString + txtFechaF.Text = DateTime.Now.AddDays(1).ToShortDateString InicializaCombos() CargaDatos() End If @@ -60,7 +60,8 @@ Partial Class ListadoContratos Private Sub CargaDatos() Dim ObjContratos As New ClsContratos - If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, CveSubProyecto:=DdlCentroCostos.SelectedValue.ToEntero, CveTipoAF:=DdlTipoUnidad.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) Then + If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, CveSubProyecto:=DdlCentroCostos.SelectedValue.ToEntero, CveTipoAF:=DdlTipoUnidad.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, + FechaInicioIngreso:=txtFechaI.Text.ToDate, FechaFinIngreso:=txtFechaF.Text.ToDate) Then GvContratos.DataSource = ObjContratos.DtResultados End If diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index ae548d7bc..f43b37598 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -662,7 +662,6 @@ Partial Class RepContratosCalendario HidCveAF.Value = GvRow.DataKey("CveAF").ToString HidCveAFDes.Value = DdlAF.SelectedItem.Text End If - TxtMotivoCambioUnidad.Text = "" DVMotivoCambioAF.Visible = False @@ -676,8 +675,6 @@ Partial Class RepContratosCalendario LblSaldo.Text = "" End If - - CveContrato = GvRow.DataKey("CveContrato").ToEntero OcultarMostrarSegundoChofer() @@ -694,14 +691,12 @@ Partial Class RepContratosCalendario TxtMotivoCambioUnidad.Text = "" DVMotivoCambioAF.Visible = False - DdlClientes.SelectedText = HidModClienteNombre.Value DdlClientes.SelectedValue = HidModCveCliente.Value DdlClientes.txtText.Value = HidModClienteNombre.Value DdlClientes.txtValue.Value = HidModCveCliente.Value chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False) - OcultarMostrarSegundoChofer() HypRemision.Text = HidRemisionSerieFolio.Value @@ -713,14 +708,15 @@ Partial Class RepContratosCalendario End If CargaAFDdl(HidCveTipoAF.Value.ToEntero) - DdlAF.SelectedValueExist(HidCveAF.Value) + If HidCveAF.Value.ToEntero > 0 AndAlso DdlAF.SelectedValue <> HidCveAF.Value Then + DdlAF.Items.Insert(0, New ListItem(GlobalDTActivoFijos(UsuarioActual.CveEmpresa, CveActivoFijo:=HidCveAF.Value.ToEntero).FiltroPrimeroValor("CodigoDescripcion"), HidCveAF.Value)) + DdlAF.SelectedValueExist(HidCveAF.Value) + End If HidCveAFDes.Value = DdlAF.SelectedItem.Text - UpModal.Update() myModalLabel.InnerText = "Contrato: " & HdnNumContrato.Value - RegistraScript("$('#ModalActualizar').modal('show');") End Sub @@ -784,11 +780,7 @@ Partial Class RepContratosCalendario Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click - Dim SubProyecto As String = "" - - - SubProyecto = DdlSubProyectos.SelectedItem.Text - + Dim SubProyecto As String = DdlSubProyectos.SelectedItem.Text Dim SbFiltros As New StringBuilder() SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|") @@ -837,8 +829,6 @@ Partial Class RepContratosCalendario End Sub - - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) CargaDatos() End Sub @@ -850,11 +840,9 @@ Partial Class RepContratosCalendario End Sub Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs) - CargaDiagramadeGant(DdlTipoVista.SelectedValue.ToEntero) End Sub - Protected Sub DdlAF_SelectedIndexChanged(sender As Object, e As EventArgs) DVMotivoCambioAF.Visible = False @@ -865,11 +853,8 @@ Partial Class RepContratosCalendario UpModal.Update() End Sub - - Protected Sub DdlTipoVistaCalendario_SelectedIndexChanged(sender As Object, e As EventArgs) CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero) End Sub - End Class