diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb
index c56dffb17..bc3794d36 100644
--- a/App_Code/ClsContratos.vb
+++ b/App_Code/ClsContratos.vb
@@ -38,7 +38,6 @@ Public Class ClsContratos
Public Property NumeroEstimacionNueva As Integer
Public Property CveEstimacionNueva As Integer
- Public Property CveChofer As Integer
@@ -135,7 +134,6 @@ Public Class ClsContratos
Public Property NumeroLicitacion As String
Public Property Observaciones As String
Public Property CveDireccionEnvio As Integer
-
Public Property CveProveedor As Integer
Public Property RazonSocial As String
Public Property CveCliente As Integer
@@ -186,11 +184,16 @@ Public Class ClsContratos
Public Property AplicaImpuestosLocales As Boolean
Public Property CveEstimacionActual As Integer
Public Property NumeroEstimacionActual As Integer
-
-
-
-
-
+ 'Viajes
+ Public Property CveTipoAF As Integer
+ Public Property CveChofer As Integer
+ Public Property CveChofer2 As Integer
+ Public Property CveAF As Integer
+ Public Property CantidadPasajeros As Integer
+ Public Property CveRuta As Integer
+ Public Property CvePartida As Integer
+ Public Property CveDestino As Integer
+ Public Property CveMasivo As Integer
#End Region
#Region " C O N T R A T O S "
@@ -227,8 +230,7 @@ Public Class ClsContratos
End Try
Return Retorno
- End Function
-
+ End Function
Public Function GetContratos(CveContrato As Integer, CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveEstatus As Integer = -1,
Optional TipoEstatus As Integer = -1, Optional TipoContrato As Integer = -1, Optional EstatusFianza As Integer = -1,
Optional CveVendedor As Integer = -1) As Boolean
@@ -299,30 +301,37 @@ Public Class ClsContratos
Me.CveVendedor = Data.Rows(0)("CveVendedor").ToString.ToEntero
Me.ImporteTotal = Data.Rows(0)("ImporteTotal").ToString.ToDecimal
Me.Lugar = Data.Rows(0)("Lugar").ToString
- Me.LimiteDeGasto = Data.Rows(0)("LimiteDeGasto").ToString.ToDouble
- CveChofer = Data.Rows(0)("CveChofer").ToString.ToEntero
-
+ Me.LimiteDeGasto = Data.Rows(0)("LimiteDeGasto").ToString.ToDouble
Observaciones = Data.Rows(0)("Observaciones").ToString
CveDireccionEnvio = Data.Rows(0)("CveDireccionEnvio").ToString.ToEntero
AplicaImpuestosLocales = CBool(Data.Rows(0)("AplicaImpuestosLocales"))
+ 'Viajes
+ Me.CveTipoAF = Data.Rows(0)("CveTipoAF").ToString.ToEntero
+ Me.CveChofer = Data.Rows(0)("CveChofer").ToString.ToEntero
+ Me.CveChofer2 = Data.Rows(0)("CveChofer2").ToString.ToEntero
+ Me.CveAF = Data.Rows(0)("CveAF").ToString.ToEntero
+ Me.CantidadPasajeros = Data.Rows(0)("CantidadPasajeros").ToString.ToEntero
+ Me.CveRuta = Data.Rows(0)("CveRuta").ToString.ToEntero
+ Me.CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero
+ Me.CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero
+ Me.CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
- End If
+ End If
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el Catálogo de Contratos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
- Public Function AddContratos(NumeroContrato As String, DescripcionContrato As String, NumeroLicitacion As String, CveProveedor As Integer, CveCliente As Integer, CveProspecto As Integer, FechaInicial As DateTime, FechaFinal As DateTime,
- Ubicacion As String, Responsable As String, CveSubProyecto As Integer, PorIVA As Double, PorAnticipo As Double, PorAmortizacionAnticipo As Double, PorGarantia As Double, Archivo As String,
- Geom As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
- Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
- Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
- Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "",
- Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional DiaMesFacturacion As Integer = 1, Optional ObservacionesGenerales As String = "",
- Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveAF As Integer = -1, Optional CantidadPasajeros As Integer = -1) As Integer
+ End Function
+ Public Function AddContratos(NumeroContrato As String, DescripcionContrato As String, NumeroLicitacion As String, CveProveedor As Integer, CveCliente As Integer, CveProspecto As Integer, FechaInicial As DateTime, FechaFinal As DateTime,
+ Ubicacion As String, Responsable As String, CveSubProyecto As Integer, PorIVA As Double, PorAnticipo As Double, PorAmortizacionAnticipo As Double, PorGarantia As Double, Archivo As String,
+ Geom As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
+ Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
+ Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
+ Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "",
+ Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional DiaMesFacturacion As Integer = 1, Optional ObservacionesGenerales As String = "",
+ Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing, Optional CantidadPasajeros As Integer = Nothing, Optional CveRuta As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = Nothing) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Con_ContratosAdd")
@@ -378,11 +387,16 @@ Public Class ClsContratos
.Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
.Add("@ObservacionesGenerales", SqlDbType.VarChar).Value = ObservacionesGenerales
- .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF
- .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
+ 'Viajes
+ .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF
+ .Add("@CveChofer", SqlDbType.Int).Value = CveChofer
+ .Add("@CveChofer2", SqlDbType.Int).Value = CveChofer2
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@CantidadPasajeros", SqlDbType.Int).Value = CantidadPasajeros
-
+ .Add("@CveRuta", SqlDbType.Int).Value = CveRuta
+ .Add("@CvePartida", SqlDbType.Int).Value = CvePartida
+ .Add("@CveDestino", SqlDbType.Int).Value = CveDestino
+ .Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo
End With
Try
@@ -400,14 +414,13 @@ Public Class ClsContratos
Return Retorno
End Function
-
Public Function UpdateContratos(CveContrato As Integer, NumeroContrato As String, DescripcionContrato As String, NumeroLicitacion As String, CveProveedor As Integer, CveCliente As Integer, CveProspecto As Integer, FechaInicial As DateTime, FechaFinal As DateTime,
Ubicacion As String, Responsable As String, CveSubProyecto As Integer, PorIVA As Double, PorAnticipo As Double, PorAmortizacionAnticipo As Double, PorGarantia As Double, Archivo As String, Geom As String,
CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False,
- Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional EstatusContrato As Integer = -1, Optional CveAF As Integer = -1) As Boolean
+ Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing, Optional CantidadPasajeros As Integer = Nothing, Optional CveRuta As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = Nothing) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Con_ContratosUpdate")
@@ -462,12 +475,17 @@ Public Class ClsContratos
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@ObservacionesGenerales", SqlDbType.VarChar).Value = ObservacionesGenerales
- .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF
+ 'Viajes
+ .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
- .Add("@EstatusContrato", SqlDbType.Int).Value = EstatusContrato
+ .Add("@CveChofer2", SqlDbType.Int).Value = CveChofer2
.Add("@CveAF", SqlDbType.Int).Value = CveAF
+ .Add("@CantidadPasajeros", SqlDbType.Int).Value = CantidadPasajeros
+ .Add("@CveRuta", SqlDbType.Int).Value = CveRuta
+ .Add("@CvePartida", SqlDbType.Int).Value = CvePartida
+ .Add("@CveDestino", SqlDbType.Int).Value = CveDestino
+ .Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo
End With
-
Try
SqlAdapter.Fill(Data)
Retorno = True
diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx
index 9f4d4df89..146ab1b88 100644
--- a/Transportes/RepContratos.aspx
+++ b/Transportes/RepContratos.aspx
@@ -14,85 +14,131 @@
}
.consulta {
- padding: 1rem 2rem;
background-color: #95A5A6;
- display: flex;
- justify-content: space-around;
- align-items: center;
+ padding: 1rem 1rem;
margin-bottom: 1rem;
}
+ .consulta_linea {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-block: .5rem;
+ gap: 1rem;
+ }
+
.consulta_campo {
display: flex;
gap: 1rem;
align-items: center;
- width: 100%;
}
.consulta_campo label {
color: white;
}
+
+ .expandir {
+ width: 2.5rem;
+ font-size: 2.5rem;
+ font-weight: 900;
+ color: white;
+ }
-
-
0 Then
Dim drr As DataRow = ObjFolio.DtResultados.FiltroPrimero("")
- LbFolio.Text = drr("FActual").ToString
+ LbFolio.Text = $"{drr("Serie").ToString}-{drr("FActual").ToString}"
End If
End If
+
UpTitulos.Update()
End Sub
@@ -69,7 +84,7 @@ Partial Class ListadoContratos
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
- If ObjContratos.AddContratos("", TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then
+ If ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then
ObjContratos.Commit()
Alert("Agregado Correctamente.")
End If
@@ -91,11 +106,30 @@ Partial Class ListadoContratos
CargaDatos()
End Sub
-
- Protected Sub LBExcel_Click(sender As Object, e As EventArgs) Handles LBExcel.Click
+ Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
End Sub
-
+ Protected Sub LnkPDF_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
+ Dim ObjContratos As New ClsContratos
+ If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
+ Dim Imagen As New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
+ Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+ Dim Cliente As String = If(DdlClientes.SelectedValue = "-1", "", $" Cliente: {DdlClientes.SelectedText}")
+ Dim dt As DataTable = ObjContratos.DtResultados
+ Dim params As New List(Of ReportParameter) From {
+ New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa),
+ New ReportParameter("FechaInicio", "-1"),
+ New ReportParameter("FechaFin", "-1"),
+ New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa),
+ New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre),
+ New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString),
+ New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))
+ }
+ ImprimirPDF("Empresas/Grales/Formatos/RepContratos.rdlc", dt, params, NombreArchivo:="Reporte Contratos")
+ Else
+ Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
+ End If
+ End Sub
Protected Sub Consultar(sender As Object, e As EventArgs)
Dim fechaInicial As String = txtFechaI.Text
Dim fechaFinal As String = txtFechaF.Text
@@ -104,12 +138,34 @@ Partial Class ListadoContratos
Dim estatus As String = ""
Dim nombreEstatus As String = ""
Dim innerEstatus As String = ""
+
+ Dim tipoUnidad As String = ""
+ Dim nombreTipoUnidad As String = ""
+ Dim innerTipoUnidad As String = ""
+
+ Dim chofer As String = ""
+ Dim nombreChofer As String = ""
+ Dim innerChofer As String = ""
+
If (DdlEstatusConsulta.SelectedValue <> "") Then
estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND"
nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1"
- innerEstatus = "INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus
-"
+ innerEstatus = " INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus "
End If
+
+ If (DdlTIpoUnidad.SelectedValue <> "") Then
+ 'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
+ 'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
+ 'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
+ End If
+
+ If (DdlChofer.SelectedValue <> "") Then
+ 'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
+ 'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
+ 'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
+ End If
+
+
Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'")
@@ -126,5 +182,14 @@ Partial Class ListadoContratos
UpTitulos.Update()
End Sub
+ Protected Sub Expandir(sender As Object, e As EventArgs)
+ If PnExpandirConsulta.Visible Then
+ PnExpandirConsulta.Visible = False
+ BtnExpandir.Text = "↑"
+ Else
+ PnExpandirConsulta.Visible = True
+ BtnExpandir.Text = "↓"
+ End If
+ End Sub
End Class
diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx
index 5fd3ecdaa..ddd19f296 100644
--- a/Transportes/RepContratosCalendario.aspx
+++ b/Transportes/RepContratosCalendario.aspx
@@ -15,35 +15,41 @@
margin-block: 1rem;
}
+ .miGrid {
+ color: white;
+ text-align: center;
+ }
+
.consulta {
- padding: 1rem 2rem;
background-color: #95A5A6;
- display: flex;
- justify-content: space-around;
- align-items: center;
+ padding: 1rem 1rem;
margin-bottom: 1rem;
}
+ .consulta_linea {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-block: .5rem;
+ gap: 1rem;
+ }
+
.consulta_campo {
display: flex;
gap: 1rem;
align-items: center;
- width: 100%;
}
.consulta_campo label {
color: white;
}
- .miGrid {
+ .expandir {
+ width: 2.5rem;
+ font-size: 2.5rem;
+ font-weight: 900;
color: white;
- text-align: center;
}
-
- .miGrid thead {
- color: black;
- text-align: center;
- }
@@ -51,6 +57,14 @@
Calendario de Viajes
+
+
diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb
index 0c363047a..91ac6060b 100644
--- a/Transportes/RepContratosCalendario.aspx.vb
+++ b/Transportes/RepContratosCalendario.aspx.vb
@@ -1,13 +1,23 @@
Option Explicit On
Option Strict On
+Imports System.Data
Imports System.Data.SqlClient
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones.ModExtensiones
-
+Imports GemBox.Spreadsheet
+Imports Microsoft.Reporting.WebForms
Partial Class RepContratosCalendario
Inherits ClsPaginas
#Region "PROPIEDADES"
+ Public Property DtAvance() As DataTable
+ Get
+ Return CType(ViewState("DtAvance"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DtAvance") = value
+ End Set
+ End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -24,12 +34,12 @@ Partial Class RepContratosCalendario
End Sub
Private Sub CargaDatos()
-
-
Dim ObjContratos As New ClsContratos
- If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
+ If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=34) Then
GvContratos.DataSource = ObjContratos.DtResultados
+ DtAvance = ObjContratos.DtResultados
GvContratos.DataBind()
+ GvContratos.HeaderStyle.ForeColor = Drawing.Color.Black
End If
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
@@ -60,15 +70,15 @@ Partial Class RepContratosCalendario
'Lista de Activos fijos
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlAF.DataBind()
- DdlAF.Items.Insert(0, New ListItem("-", ""))
+ DdlAF.Items.Insert(0, New ListItem("-", "0"))
'Lista Chofer'
DdlChofer.DataSource = GlobalDTRHPersonal(185)
DdlChofer.DataBind()
- DdlChofer.Items.Insert(0, New ListItem("-", ""))
+ DdlChofer.Items.Insert(0, New ListItem("-", "0"))
DdlChofer1.DataSource = GlobalDTRHPersonal(185)
DdlChofer1.DataBind()
- DdlChofer1.Items.Insert(0, New ListItem("-", ""))
+ DdlChofer1.Items.Insert(0, New ListItem("-", "0"))
End Sub
@@ -82,36 +92,7 @@ Partial Class RepContratosCalendario
RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
- Protected Sub Consultar(sender As Object, e As EventArgs)
- Dim fechaInicial As String = txtFechaI.Text
- Dim fechaFinal As String = txtFechaF.Text
- Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND")
- Dim estatus As String = ""
- Dim nombreEstatus As String = ""
- Dim innerEstatus As String = ""
- If (DdlEstatusConsulta.SelectedValue <> "") Then
- estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND"
- nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1"
- innerEstatus = "INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus
-"
- End If
- Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'")
-
-
- Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreCompleto {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}"
-
- Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
- Using command As New SqlCommand(query, connection)
- connection.Open()
- Dim reader As SqlDataReader = command.ExecuteReader()
- GvContratos.DataSource = reader
- GvContratos.DataBind()
- End Using
- End Using
-
- UpTitulos.Update()
- End Sub
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim fechaS As Date = TxtFechaSalida.Text.ToDate
Dim fechaR As Date = TxtFechaRegreso.Text.ToDate
@@ -134,13 +115,102 @@ Partial Class RepContratosCalendario
TxtObservaciones.Text = GvRow.DataKey("Observaciones")
TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
- TxtFechaSalida.Text = GvRow.DataKey("FechaInicial").ToDateTime.ToString("MM/dd/yyyy")
- TxtFechaRegreso.Text = GvRow.DataKey("FechaFinal").ToDateTime.ToString("MM/dd/yyyy")
+ TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm:ss tt")
+ TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm:ss tt")
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
+ DdlClientes.SelectedText = GvRow.DataKey("NombreComercial")
DdlAF.SelectedValue = GvRow.DataKey("CveAF")
DdlChofer.SelectedValue = GvRow.DataKey("CveChofer")
+ DdlChofer.SelectedValue = GvRow.DataKey("CveChofer2")
+ DdlEstatusContrato.SelectedValue = GvRow.DataKey("CveContratosEstatus")
UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
+ Protected Sub Consultar(sender As Object, e As EventArgs)
+ Dim fechaInicial As String = txtFechaI.Text
+ Dim fechaFinal As String = txtFechaF.Text
+
+ Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND")
+ Dim estatus As String = ""
+ Dim nombreEstatus As String = ""
+ Dim innerEstatus As String = ""
+
+ Dim tipoUnidad As String = ""
+ Dim nombreTipoUnidad As String = ""
+ Dim innerTipoUnidad As String = ""
+
+ Dim chofer As String = ""
+ Dim nombreChofer As String = ""
+ Dim innerChofer As String = ""
+
+ If (DdlEstatusConsulta.SelectedValue <> "") Then
+ estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND"
+ nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1"
+ innerEstatus = " INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus "
+ End If
+
+ If (DdlTIpoUnidad.SelectedValue <> "") Then
+ 'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
+ 'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
+ 'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
+ End If
+
+ If (DdlChofer.SelectedValue <> "") Then
+ 'tipoUnidad = $"C.CveContratosEstatus = {DdlTIpoUnidad.SelectedValue} AND"
+ 'nombreTipoUnidad = ", CE.ContratoTipoUnidad As ContratoTipoUnidad1"
+ 'innerTipoUnidad = " INNER JOIN Con_ContratosTipoUnidad CE with(nolock) ON CE.CveContratoTipoUnidad = C.CveContratosEstatus "
+ End If
+
+
+ Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'")
+
+
+ Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}"
+
+ Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
+ Using command As New SqlCommand(query, connection)
+ connection.Open()
+ Dim reader As SqlDataReader = command.ExecuteReader()
+ GvContratos.DataSource = reader
+ GvContratos.DataBind()
+ End Using
+ End Using
+
+ UpTitulos.Update()
+ End Sub
+ Protected Sub Expandir(sender As Object, e As EventArgs)
+ If PnExpandirConsulta.Visible Then
+ PnExpandirConsulta.Visible = False
+ BtnExpandir.Text = "↑"
+ Else
+ PnExpandirConsulta.Visible = True
+ BtnExpandir.Text = "↓"
+
+ End If
+ End Sub
+ Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
+ GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
+ End Sub
+ Protected Sub LnkPDF_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
+ Dim ObjContratos As New ClsContratos
+ If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
+ Dim Imagen As New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
+ Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+ Dim Cliente As String = If(DdlClientes.SelectedValue = "-1", "", $" Cliente: {DdlClientes.SelectedText}")
+ Dim dt As DataTable = ObjContratos.DtResultados
+ Dim params As New List(Of ReportParameter) From {
+ New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa),
+ New ReportParameter("FechaInicio", "-1"),
+ New ReportParameter("FechaFin", "-1"),
+ New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa),
+ New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre),
+ New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString),
+ New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))
+ }
+ ImprimirPDF("Empresas/Grales/Formatos/RepContratos.rdlc", dt, params, NombreArchivo:="Reporte Contratos")
+ Else
+ Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
+ End If
+ End Sub
End Class
diff --git a/Transportes/RepViajes.aspx b/Transportes/RepViajes.aspx
index cc266bd7e..0440a31bf 100644
--- a/Transportes/RepViajes.aspx
+++ b/Transportes/RepViajes.aspx
@@ -15,6 +15,11 @@
.masivo {
color: green;
}
+
+ .masivo_block {
+ margin: 1rem;
+ border: grey 1px solid;
+ }
@@ -28,251 +33,207 @@
-
-
-