-- filtros de reportes de contratos por fechaing
This commit is contained in:
@@ -197,7 +197,12 @@ Public Class ClsContratos
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " C O N T R A T O S "
|
#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
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Con_ContratosReporteGet")
|
DataAdapter("PA_Con_ContratosReporteGet")
|
||||||
|
|
||||||
@@ -211,6 +216,8 @@ Public Class ClsContratos
|
|||||||
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
|
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
|
||||||
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
|
.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
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -418,10 +418,7 @@ Partial Class RepContratoDetalle
|
|||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorProceso Then
|
If Not ErrorProceso Then
|
||||||
|
|
||||||
If CveVentaRemision > 0 AndAlso (CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero OrElse
|
If CveVentaRemision > 0 AndAlso (CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero OrElse
|
||||||
CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero OrElse
|
CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero OrElse
|
||||||
ImporteOrigial <> TxtImporte.Text.ToDecimal OrElse
|
ImporteOrigial <> TxtImporte.Text.ToDecimal OrElse
|
||||||
@@ -434,8 +431,6 @@ Partial Class RepContratoDetalle
|
|||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ErrorProceso Then
|
If Not ErrorProceso Then
|
||||||
@@ -445,15 +440,11 @@ Partial Class RepContratoDetalle
|
|||||||
AgregarABitacora($"Actualización del contrato {CveContrato}")
|
AgregarABitacora($"Actualización del contrato {CveContrato}")
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
Alert("Contrato actualizado correctamente")
|
Alert("Contrato actualizado correctamente")
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
|
Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
|
||||||
ObjContratos.RollBack()
|
ObjContratos.RollBack()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean
|
Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Partial Class ListadoContratos
|
|||||||
|
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
|
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
|
||||||
txtFechaF.Text = DateTime.Now.AddDays(15).ToShortDateString
|
txtFechaF.Text = DateTime.Now.AddDays(1).ToShortDateString
|
||||||
InicializaCombos()
|
InicializaCombos()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End If
|
End If
|
||||||
@@ -60,7 +60,8 @@ Partial Class ListadoContratos
|
|||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjContratos As New ClsContratos
|
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
|
GvContratos.DataSource = ObjContratos.DtResultados
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -662,7 +662,6 @@ Partial Class RepContratosCalendario
|
|||||||
HidCveAF.Value = GvRow.DataKey("CveAF").ToString
|
HidCveAF.Value = GvRow.DataKey("CveAF").ToString
|
||||||
HidCveAFDes.Value = DdlAF.SelectedItem.Text
|
HidCveAFDes.Value = DdlAF.SelectedItem.Text
|
||||||
End If
|
End If
|
||||||
|
|
||||||
TxtMotivoCambioUnidad.Text = ""
|
TxtMotivoCambioUnidad.Text = ""
|
||||||
DVMotivoCambioAF.Visible = False
|
DVMotivoCambioAF.Visible = False
|
||||||
|
|
||||||
@@ -676,8 +675,6 @@ Partial Class RepContratosCalendario
|
|||||||
LblSaldo.Text = ""
|
LblSaldo.Text = ""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CveContrato = GvRow.DataKey("CveContrato").ToEntero
|
CveContrato = GvRow.DataKey("CveContrato").ToEntero
|
||||||
OcultarMostrarSegundoChofer()
|
OcultarMostrarSegundoChofer()
|
||||||
|
|
||||||
@@ -694,14 +691,12 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
TxtMotivoCambioUnidad.Text = ""
|
TxtMotivoCambioUnidad.Text = ""
|
||||||
DVMotivoCambioAF.Visible = False
|
DVMotivoCambioAF.Visible = False
|
||||||
|
|
||||||
DdlClientes.SelectedText = HidModClienteNombre.Value
|
DdlClientes.SelectedText = HidModClienteNombre.Value
|
||||||
DdlClientes.SelectedValue = HidModCveCliente.Value
|
DdlClientes.SelectedValue = HidModCveCliente.Value
|
||||||
DdlClientes.txtText.Value = HidModClienteNombre.Value
|
DdlClientes.txtText.Value = HidModClienteNombre.Value
|
||||||
DdlClientes.txtValue.Value = HidModCveCliente.Value
|
DdlClientes.txtValue.Value = HidModCveCliente.Value
|
||||||
|
|
||||||
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
|
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
|
||||||
|
|
||||||
OcultarMostrarSegundoChofer()
|
OcultarMostrarSegundoChofer()
|
||||||
|
|
||||||
HypRemision.Text = HidRemisionSerieFolio.Value
|
HypRemision.Text = HidRemisionSerieFolio.Value
|
||||||
@@ -713,14 +708,15 @@ Partial Class RepContratosCalendario
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
CargaAFDdl(HidCveTipoAF.Value.ToEntero)
|
CargaAFDdl(HidCveTipoAF.Value.ToEntero)
|
||||||
|
|
||||||
DdlAF.SelectedValueExist(HidCveAF.Value)
|
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
|
HidCveAFDes.Value = DdlAF.SelectedItem.Text
|
||||||
|
|
||||||
UpModal.Update()
|
UpModal.Update()
|
||||||
myModalLabel.InnerText = "Contrato: " & HdnNumContrato.Value
|
myModalLabel.InnerText = "Contrato: " & HdnNumContrato.Value
|
||||||
|
|
||||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -784,11 +780,7 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||||
|
|
||||||
Dim SubProyecto As String = ""
|
Dim SubProyecto As String = DdlSubProyectos.SelectedItem.Text
|
||||||
|
|
||||||
|
|
||||||
SubProyecto = DdlSubProyectos.SelectedItem.Text
|
|
||||||
|
|
||||||
|
|
||||||
Dim SbFiltros As New StringBuilder()
|
Dim SbFiltros As New StringBuilder()
|
||||||
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||||
@@ -837,8 +829,6 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -850,11 +840,9 @@ Partial Class RepContratosCalendario
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
CargaDiagramadeGant(DdlTipoVista.SelectedValue.ToEntero)
|
CargaDiagramadeGant(DdlTipoVista.SelectedValue.ToEntero)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Protected Sub DdlAF_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlAF_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
DVMotivoCambioAF.Visible = False
|
DVMotivoCambioAF.Visible = False
|
||||||
|
|
||||||
@@ -865,11 +853,8 @@ Partial Class RepContratosCalendario
|
|||||||
UpModal.Update()
|
UpModal.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub DdlTipoVistaCalendario_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlTipoVistaCalendario_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero)
|
CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user