From af7f9069b034e6ea6c95f3b95e0cf6fbb441c414 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Mon, 5 Feb 2024 15:46:41 -0700 Subject: [PATCH] =?UTF-8?q?--Se=20hicieron=20descoment=C3=B3=20propiedad?= =?UTF-8?q?=20de=20EstatusContratos=20por=20que=20se=20utilizar=C3=ADa=20e?= =?UTF-8?q?n=20V&A=20y=20se=20modifican=20los=20m=C3=A9todos=20correspondi?= =?UTF-8?q?entes.=20Se=20agrega=20c=C3=B3digo=20de=20color=20al=20m=C3=A9t?= =?UTF-8?q?odo=20de=20GetContratos=20de=20CargaEvento.ashx=20dependiendo?= =?UTF-8?q?=20el=20estatus=20del=20contrato.=20=20Se=20agregan=20los=20dat?= =?UTF-8?q?akey=20a=20GvContratos,=20la=20columna=20de=20estatus=20con=20e?= =?UTF-8?q?l=20mismo=20c=C3=B3digo=20de=20color=20que=20en=20CargaEventos?= =?UTF-8?q?=20y=20se=20hace=20limpieza=20en=20VB=20.Se=20agrega=20al=20lis?= =?UTF-8?q?tado=20en=20calendario=20los=20textbox=20para=20elegir=20tipo?= =?UTF-8?q?=20de=20unidad=20y=20AF=20para=20el=20contrato=20y=20se=20ocult?= =?UTF-8?q?an=20los=20campos=20de=20costos=20en=20el=20modal.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContratos.vb | 8 +- Ashx/CargaEventos.ashx | 34 +- Transportes/RepContratos.aspx | 500 ++++++++++---------- Transportes/RepContratos.aspx.vb | 48 +- Transportes/RepContratosCalendario.aspx | 506 +++++++++++---------- Transportes/RepContratosCalendario.aspx.vb | 13 +- 6 files changed, 572 insertions(+), 537 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 4b8b847ba..361d518ea 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -158,7 +158,7 @@ Public Class ClsContratos Public Property PorGarantia As Double Public Property CveContratosEstatus As Integer Public Property Estatus As Integer - 'Public Property EstatusContrato As Integer + Public Property EstatusContrato As Integer Public Property Archivo As String Public Property Geom As String Public Property FechaIng As DateTime @@ -270,7 +270,7 @@ Public Class ClsContratos Me.PorAnticipo = Data.Rows(0)("PorAnticipo").ToString.ToDouble Me.PorAmortizacionAnticipo = Data.Rows(0)("PorAmortizacionAnticipo").ToString.ToDouble Me.PorGarantia = Data.Rows(0)("PorGarantia").ToString.ToDouble - 'Me.EstatusContrato = Data.Rows(0)("EstatusContrato").ToString.ToEntero + Me.EstatusContrato = Data.Rows(0)("EstatusContrato").ToString.ToEntero Me.Archivo = Data.Rows(0)("Archivo").ToString Me.Geom = Data.Rows(0)("Geom").ToString Me.FechaIng = Data.Rows(0)("FechaIng").ToString.ToDate @@ -406,7 +406,7 @@ Public Class ClsContratos 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) As Boolean + 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 Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosUpdate") @@ -463,6 +463,8 @@ Public Class ClsContratos .Add("@ObservacionesGenerales", SqlDbType.VarChar).Value = ObservacionesGenerales .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF .Add("@CveChofer", SqlDbType.Int).Value = CveChofer + .Add("@EstatusContrato", SqlDbType.Int).Value = EstatusContrato + .Add("@CveAF", SqlDbType.Int).Value = CveAF End With Try diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 8d250faba..50a1a372d 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -442,7 +442,6 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Dim DT_EstatusOS As New DataTable Dim usuarioActual_ As Usuario = UsuarioActual(context) Dim ErrorEventos As Boolean = False - Dim Colores() As String = {"#006699", "#0099cc", "#0066cc", "#0033cc", "#0000ff", "#3333ff", "#3333ff", "#6600ff", "#9933ff", "#cc00ff", "#cc00cc", "#cc0099", "#cc3399", "#cc6699", "#cc0066", "#009933", "#00cc00", "#00cc66", "#009999", "#669900", "#99cc00", "#cccc00", "#cc9900", "#ff9900", "#006666", "#669999"} Dim tipoVista As String = context.Request("tipoVista") DT_SubProyectos.Columns.Add("CveSubProyecto", GetType(Integer)) DT_SubProyectos.Columns.Add("backgroundColor") @@ -458,19 +457,31 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState For Each dr As DataRow In ObjContratos.DtResultados.Rows Dim cevent As CalendarEvent = New CalendarEvent() + Dim estatus As Integer = dr("EstatusContrato").ToString.ToEntero cevent.id = dr("CveContrato").ToString.ToEntero cevent.title = dr("DescripcionContrato").ToString cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime) - cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)) 'Agregar una hora, fecha final como default + cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)) cevent.allDay = False cevent.NombreAcercamiento = dr("Ubicacion").ToString cevent.CveCliente = dr("CveCliente").ToString.ToEntero - cevent.CveActivoFijo = dr("CveTipoAF").ToString.ToEntero cevent.CvePersonal = dr("CveChofer").ToString.ToEntero cevent.Dolares = dr("Importe").ToString.ToDecimal cevent.Pesos = dr("ImporteMax").ToString.ToDecimal cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal + cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero + + Select Case estatus + Case 1 + cevent.backgroundColor = "#45B6AF" + Case 2 + cevent.backgroundColor = "#89C4F4" + Case 3 + cevent.backgroundColor = "#F3565D" + End Select + + If Not cevent.recurrenciatipo > 0 Then @@ -554,24 +565,9 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime) cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)) cevent.NombreAcercamiento = dr("Ubicacion").ToString - + cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero cevent.allDay = False - 'cevent.CveEventoEstatus = dr("NumeroContrato").ToString.ToEntero - 'cevent.CveEventoEstatus = dr("CveEventoEstatus").ToString.ToEntero - 'cevent.cveagendatipo = dr("CveAgendaTipo").ToString - 'cevent.prioridad = dr("CvePrioridad").ToString.ToEntero - 'cevent.backgroundColor = dr("BackGroundColor").ToString - 'cevent.recurrenciatipo = dr("RecurrenciaTipo").ToString.ToEntero - 'cevent.frecuencia = dr("Frecuencia").ToString.ToEntero - 'cevent.diassemana = dr("DiasSemana").ToString - 'cevent.dia = dr("Dia").ToString.ToEntero - 'cevent.mes = dr("Mes").ToString.ToEntero - 'cevent.recurrenciafin = dr("RecurrenciaFin").ToString - 'cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero - 'cevent.Prospecto = dr("Prospecto").ToString - - '11/05/2018 - Evento Gasto Recurrente 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index 29f826dbf..64d99615b 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -34,18 +34,18 @@ - - + +
  • - Agregar Contrato + Agregar Contrato
  • Generar Excel
  • -
    - - - +
    + + +
    @@ -58,259 +58,263 @@ style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fecha
    + Salida +
    + + + +
    + + + + Fecha
    + Regreso +
    + + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + + - diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index f3024068b..71c7f3def 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -22,25 +22,15 @@ Partial Class ListadoContratos End If End Sub Private Sub InicializaCombos() - 'Lista Activos Fijos' - 'Dim ObjAF As New ClsAF() - 'If ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, 1, "-1", -1, -1, -1) Then - ' If ObjAF.DtResultados.Rows.Count > 0 Then - ' DdlAF.DataSource = ObjAF.DtResultados - ' DdlAF.Items.Insert(0, New ListItem("Seleccione", "")) - ' End If - 'End If - 'ObjAF.Dispose() DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa) DdlTipoAF.DataBind() - + DdlTipoAF.Items.Insert(0, New ListItem("Seleccione", "")) 'Lista Chofer' DdlChofer.DataSource = GlobalDTRHPersonal(185) DdlChofer.DataBind() DdlChofer.Items.Insert(0, New ListItem("Seleccione", "")) - UpModal.Update() End Sub Private Sub CargaDatos() @@ -48,25 +38,33 @@ Partial Class ListadoContratos If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then GvContratos.DataSource = ObjContratos.DtResultados End If - ObjContratos.Dispose() GvContratos.DataBind() UpTitulos.Update() + Console.WriteLine(DdlClientes) End Sub - Protected Sub MostrarModal(Optional Descripcion As String = "", Optional FechaSalida As String = "", Optional FechaRegreso As String = "", Optional Observaciones As String = "", Optional Ubicacion As String = "", Optional Transporte As String = "", Optional Cliente As String = "", Optional Dolares As String = "", Optional Pesos As String = "", Optional Anticipo As String = "", Optional Boton As String = "Guardar", Optional Chofer As String = "") + Protected Sub MostrarModal(Optional Descripcion As String = "", Optional FechaSalida As String = "", Optional FechaRegreso As String = "", Optional Observaciones As String = "", Optional Ubicacion As String = "", Optional Transporte As String = "", Optional Cliente As String = "", Optional Dolares As String = "", Optional Pesos As String = "", Optional Anticipo As String = "", Optional Boton As String = "Guardar", Optional AF As String = "", Optional Chofer As String = "", Optional EstatusContrato As String = "") + LbEstatus.Visible = False + DdlEstatusContrato.Visible = False + DdlClientes.SelectedText = Cliente TxtDescripcion.Text = Descripcion + TxtUbicacion.Text = Ubicacion TxtFechaSalida.Text = FechaSalida TxtFechaRegreso.Text = FechaRegreso - TxtObservaciones.Text = Observaciones - TxtUbicacion.Text = Ubicacion - DdlAF.SelectedValue = Transporte - DdlClientes.SelectedText = Cliente + DdlTipoAF.SelectedValue = AF DdlChofer.SelectedValue = Chofer + TxtObservaciones.Text = Observaciones TxtDolares.Text = Dolares TxtPesos.Text = Pesos TxtAnticipo.Text = Anticipo BtnGuardar.Text = Boton + If EstatusContrato <> "" Then + LbEstatus.Visible = True + DdlEstatusContrato.Visible = True + DdlEstatusContrato.SelectedValue = EstatusContrato + End If + 'DdlEstatusContrato.Text = EstatusContrato myModalLabel.InnerHtml = $"{Boton} Contrato" UpModal.Update() RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) @@ -86,27 +84,21 @@ Partial Class ListadoContratos Try Dim CveEstatusInicial As Integer = 10 - Dim CveContratoHijo As Integer = -1 - Dim CveContratoTipo As Integer = 2 - Dim retorno As Boolean = False If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero End If 'Agregar contrato If BtnGuardar.Text = "Guardar" Then - CveContratoHijo = 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:=1, CveTipoAF:=DdlTransporte.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text) - If CveContratoHijo > 0 Then + 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:=1, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then ObjContratos.Commit() Alert("Agregado Correctamente.") End If End If - 'Actualizar contrato If BtnGuardar.Text = "Editar" Then - retorno = ObjContratos.UpdateContratos(CveContrato, "", TxtDescripcion.Text, "", -1, 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:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTransporte.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text) + If ObjContratos.UpdateContratos(CveContrato, "", TxtDescripcion.Text, "", -1, 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:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text, EstatusContrato:=DdlEstatusContrato.SelectedValue.ToEntero) Then - If retorno Then ObjContratos.Commit() Alert("Actualizado Correctamente.") End If @@ -118,7 +110,7 @@ Partial Class ListadoContratos TxtObservaciones.Text = "" TxtUbicacion.Text = "" DdlClientes.SelectedText = "" - DdlTransporte.SelectedValue = "" + DdlTipoAF.SelectedValue = "" DdlChofer.SelectedValue = "" TxtDolares.Text = "" TxtPesos.Text = "" @@ -128,8 +120,8 @@ Partial Class ListadoContratos Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError) ObjContratos.RollBack() Finally - ObjContratos.Dispose() CargaDatos() + ObjContratos.Dispose() End Try @@ -138,7 +130,7 @@ Partial Class ListadoContratos Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) ViewState("CveContrato") = GvRow.DataKey("CveContrato") MostrarModal( - Descripcion:=GvRow.DataKey("DescripcionContrato"), FechaSalida:=GvRow.DataKey("FechaInicial").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), FechaRegreso:=GvRow.DataKey("FechaFinal").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), Observaciones:=GvRow.DataKey("Observaciones"), Ubicacion:=GvRow.DataKey("Ubicacion"), Transporte:=GvRow.DataKey("CveTipoAF"), Cliente:=GvRow.DataKey("CveCliente"), Dolares:=GvRow.DataKey("Importe"), Pesos:=GvRow.DataKey("ImporteMax"), Anticipo:=GvRow.DataKey("ImporteMin"), Boton:="Editar", Chofer:=GvRow.DataKey("CveChofer")) + Descripcion:=GvRow.DataKey("DescripcionContrato"), FechaSalida:=GvRow.DataKey("FechaInicial").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), FechaRegreso:=GvRow.DataKey("FechaFinal").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), Observaciones:=GvRow.DataKey("Observaciones"), Ubicacion:=GvRow.DataKey("Ubicacion"), Transporte:=GvRow.DataKey("CveTipoAF"), Cliente:=GvRow.DataKey("CveCliente"), Dolares:=GvRow.DataKey("Importe"), Pesos:=GvRow.DataKey("ImporteMax"), Anticipo:=GvRow.DataKey("ImporteMin"), Boton:="Editar", Chofer:=GvRow.DataKey("CveChofer"), EstatusContrato:=GvRow.DataKey("EstatusContrato"), AF:=GvRow.DataKey("CveTipoAF")) End Sub Protected Sub RemoveContrato(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index d441eabd3..a09dd79df 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -10,6 +10,10 @@ align-items: center; gap: 2rem; } + + .my-1 { + margin-block: 1rem; + } @@ -20,267 +24,303 @@ - <%--Calendario Tab--%> - + <%--Calendario Tab--%> + - - -
    -
    -
    -
    -
    -

    Tipo de Vista

    -
    - - - - + + +
    +
    +
    +
    +
    +

    Tipo de Vista

    + + + + +
    -
    -
    -
    +
    +
    +
    - - - <%--Contratos Tab--%> - - - - + + + <%--Contratos Tab--%> + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - Fecha
    - Salida -
    - - - -
    + + + Fecha
    + Salida +
    + + + +
    - - - Fecha
    - Regreso -
    - - - -
    + + + Fecha
    + Regreso +
    + + + +
    -
    -
    -
    -
    - + + + + + + + + + + +