From 6a1bfc0893ee235ab8afb89b9f9fd50441659686 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 9 May 2024 16:48:23 -0700 Subject: [PATCH] OI Tarea Cierre con idicador Tipo 1 --- App_Code/CalendarEvent.vb | 1 + Ashx/CargaEventos.ashx | 1 + OI/Proyecto.aspx.cs | 2 +- OI/RepIndicadoresEMD.aspx | 289 +++++-------------- OI/RepIndicadoresEMD.aspx.vb | 351 ++++++++++++------------ OI/TareaDetalle.aspx.cs | 77 +++++- Transportes/RepContratos.aspx | 4 +- Transportes/RepContratosCalendario.aspx | 35 ++- 8 files changed, 358 insertions(+), 402 deletions(-) diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb index 0a47fc29f..db77a2884 100644 --- a/App_Code/CalendarEvent.vb +++ b/App_Code/CalendarEvent.vb @@ -7,6 +7,7 @@ Public Class CalendarEvent Public Property description As String Public Property start As String Public Property [end] As String + Public Property FechaFinal As String Public Property allDay As Boolean Public Property CveEventoEstatus As Integer Public Property cveagendatipo As String diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index f87a5a85d..9777b70b6 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -461,6 +461,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState 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)) + cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime) cevent.allDay = False cevent.NombreAcercamiento = dr("Ubicacion").ToString cevent.CveCliente = dr("CveCliente").ToString.ToEntero diff --git a/OI/Proyecto.aspx.cs b/OI/Proyecto.aspx.cs index 7cc797d2b..cfb70ae41 100644 --- a/OI/Proyecto.aspx.cs +++ b/OI/Proyecto.aspx.cs @@ -57,7 +57,7 @@ public partial class OI_Proyecto : ClsPaginas } - if (UsuarioActual.CveEmpresa == 13) + if (UsuarioActual.CveEmpresa == 13 ) { DvIndicador.Visible = true; } diff --git a/OI/RepIndicadoresEMD.aspx b/OI/RepIndicadoresEMD.aspx index 3cb62f323..df9eba8c3 100644 --- a/OI/RepIndicadoresEMD.aspx +++ b/OI/RepIndicadoresEMD.aspx @@ -6,20 +6,18 @@ - Reporte de Comisiones + Reporte de Indicadores - Reporte de Comisiones + Reporte de Indicadores -
  • - -
  • +
  • Excel
  • @@ -42,62 +40,48 @@
    -
    - - -
    - Fecha Inicio: -
    -
    -
    - - - - -
    - - - - - - -
    -
    - Fecha Fin: - -
    -
    -
    - - - - -
    - - - - - - -
    - - -
    - - -
    - - -
    - - -
    +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + +
    + + : +
    + + +
    - -
    - - -
    @@ -113,174 +97,53 @@ - - - - - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    -
    -
    - - - - - - - - - - - - - - - + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    +
    + + - - + + - + + + + + + + + + + - - + + -
    -
    +
    +
    -
    -
    - -
    -
    - - - - - -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    -
    -
    -
    - - - - - - - - - - - - -
    -
    - - -
    -
    -
    -
    - -
    - - + + - + diff --git a/OI/RepIndicadoresEMD.aspx.vb b/OI/RepIndicadoresEMD.aspx.vb index 366cd4397..3113521fc 100644 --- a/OI/RepIndicadoresEMD.aspx.vb +++ b/OI/RepIndicadoresEMD.aspx.vb @@ -2,6 +2,8 @@ Option Strict On Imports System.Data +Imports CrystalDecisions.Shared.Json +Imports DocumentFormat.OpenXml.Vml.Office Imports Extensiones @@ -24,99 +26,206 @@ Partial Class OI_RepIndicadoresEMD If Not Page.IsPostBack Then Dim FechaInicial As Date = New Date(10) - - txtFechaI.Text = Now.FirstDayOfMonth.ToString("dd/MM/yyyy") - txtFechaF.Text = Now.ToString("dd/MM/yyyy") CargaCombos() CargaDatos() End If End Sub - Private Sub CargaCombos() - 'If UsuarioActual.Empresa.Funcionalidad(302) = "1" AndAlso DdlSubProyectoDatos.SelectedValue.ToEntero() > 0 Then - ' DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros(String.Format("VendedorTipo IN (1,4) AND (CveSubProyecto IS NULL OR CveSubProyecto = {0})", DdlSubProyectoDatos.SelectedValue)) - 'Else - DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("VendedorTipo = 1") - 'End If - DdlVendedor.DataBind() - DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1")) - - - DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") - DdlMedico.DataBind() - DdlMedico.Items.Insert(0, New ListItem("Todos", "-1")) - - DdlUsuarioAtendio.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) - DdlUsuarioAtendio.DataBind() - DdlUsuarioAtendio.Items.Insert(0, New ListItem("Todos", "-1")) - + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, AplicaTodos:="Todos") End Sub + + Private Function CrearTablaDatos() As DataTable + Dim DTDatos As New DataTable + + DTDatos.Columns.Add("Numero", GetType(Integer)) + DTDatos.Columns.Add("Indicador", GetType(String)) + DTDatos.Columns.Add("Comentarios", GetType(String)) + DTDatos.Columns.Add("ACARREO SAN JOSE A QUILA", GetType(String)) + DTDatos.Columns.Add("PIPER MERIDIAN M500", GetType(String)) + DTDatos.Columns.Add("PRESA JALES PEÑA COLORADA", GetType(String)) + DTDatos.Columns.Add("MINA LA CRUZ", GetType(String)) + DTDatos.Columns.Add("TOGUI -UBER", GetType(String)) + DTDatos.Columns.Add("SAN IGNACIO", GetType(String)) + DTDatos.Columns.Add("Porcentaje", GetType(String)) + 'DTDatos.Columns.Add("", GetType(String)) + DTDatos.AcceptChanges() + + Dim nRow1 As DataRow = DTDatos.NewRow + Dim nRow2 As DataRow = DTDatos.NewRow + Dim nRow3 As DataRow = DTDatos.NewRow + Dim nRow4 As DataRow = DTDatos.NewRow + Dim nRow5 As DataRow = DTDatos.NewRow + Dim nRow6 As DataRow = DTDatos.NewRow + Dim nRow7 As DataRow = DTDatos.NewRow + Dim nRow8 As DataRow = DTDatos.NewRow + Dim nRow9 As DataRow = DTDatos.NewRow + Dim nRow10 As DataRow = DTDatos.NewRow + + + + 'ACARREO SAN JOSE A QUILA + 'PIPER MERIDIAN M500 + 'PRESA JALES PEÑA COLORADA + 'MINA LA CRUZ + 'TOGUI -UBER + 'SAN IGNACIO + + nRow1("Numero") = "1" + nRow1("Indicador") = "Programación de bolsa aprobada en tiempo" + nRow1("Comentarios") = "Si programaron en tiempo según la tarea" + nRow1("ACARREO SAN JOSE A QUILA") = "1" + nRow1("PIPER MERIDIAN M500") = "1" + nRow1("PRESA JALES PEÑA COLORADA") = "1" + nRow1("MINA LA CRUZ") = "0" + nRow1("TOGUI -UBER") = "1" + nRow1("SAN IGNACIO") = "1" + nRow1("Porcentaje") = "67%" + + nRow2("Numero") = "2" + nRow2("Indicador") = "Solicitudes fuera de presupuesto" + nRow2("Comentarios") = "Hacer cambios a presupuestos" + nRow2("ACARREO SAN JOSE A QUILA") = "1" + nRow2("PIPER MERIDIAN M500") = "0" + nRow2("PRESA JALES PEÑA COLORADA") = "0" + nRow2("MINA LA CRUZ") = "0" + nRow2("TOGUI -UBER") = "1" + nRow2("SAN IGNACIO") = "1" + nRow2("Porcentaje") = "67%" + + nRow3("Numero") = "3" + nRow3("Indicador") = "Viáticos dentro de presupuesto" + nRow3("Comentarios") = "Si se salió de lo gastado en el rubro de viáticos" + nRow3("ACARREO SAN JOSE A QUILA") = "" + nRow3("PIPER MERIDIAN M500") = "" + nRow3("PRESA JALES PEÑA COLORADA") = "" + nRow3("MINA LA CRUZ") = "" + nRow3("TOGUI -UBER") = "" + nRow3("SAN IGNACIO") = "" + nRow3("Porcentaje") = "" + + nRow4("Numero") = "4" + nRow4("Indicador") = "Viáticos no deducibles" + nRow4("Comentarios") = "Viáticos no deducibles" + nRow4("ACARREO SAN JOSE A QUILA") = "" + nRow4("PIPER MERIDIAN M500") = "" + nRow4("PRESA JALES PEÑA COLORADA") = "" + nRow4("MINA LA CRUZ") = "" + nRow4("TOGUI -UBER") = "" + nRow4("SAN IGNACIO") = "" + nRow4("Porcentaje") = "" + + nRow5("Numero") = "5" + nRow5("Indicador") = "Utilidad operativa" + nRow5("Comentarios") = "Ing-Egs" + nRow5("ACARREO SAN JOSE A QUILA") = "" + nRow5("PIPER MERIDIAN M500") = "" + nRow5("PRESA JALES PEÑA COLORADA") = "" + nRow5("MINA LA CRUZ") = "" + nRow5("TOGUI -UBER") = "" + nRow5("SAN IGNACIO") = "" + nRow5("Porcentaje") = "" + + nRow6("Numero") = "11" + nRow6("Indicador") = "Factura ligada a orden de compra en SIG" + nRow6("Comentarios") = "Relación" + nRow6("ACARREO SAN JOSE A QUILA") = "" + nRow6("PIPER MERIDIAN M500") = "" + nRow6("PRESA JALES PEÑA COLORADA") = "" + nRow6("MINA LA CRUZ") = "" + nRow6("TOGUI -UBER") = "" + nRow6("SAN IGNACIO") = "" + nRow6("Porcentaje") = "" + + nRow7("Numero") = "12" + nRow7("Indicador") = "Cumplimiento del programa de mantenimientos preventivos" + nRow7("Comentarios") = "" + nRow7("ACARREO SAN JOSE A QUILA") = "ND" + nRow7("PIPER MERIDIAN M500") = "ND" + nRow7("PRESA JALES PEÑA COLORADA") = "ND" + nRow7("MINA LA CRUZ") = "ND" + nRow7("TOGUI -UBER") = "ND" + nRow7("SAN IGNACIO") = "ND" + nRow7("Porcentaje") = "50%" + + nRow8("Numero") = "13" + nRow8("Indicador") = "Relación entre mantenimiento preventivo y correctivo" + nRow8("Comentarios") = "" + nRow8("ACARREO SAN JOSE A QUILA") = "ND" + nRow8("PIPER MERIDIAN M500") = "ND" + nRow8("PRESA JALES PEÑA COLORADA") = "ND" + nRow8("MINA LA CRUZ") = "ND" + nRow8("TOGUI -UBER") = "ND" + nRow8("SAN IGNACIO") = "ND" + nRow8("Porcentaje") = "50%" + + nRow9("Numero") = "14" + nRow9("Indicador") = "Consumo de combustible" + nRow9("Comentarios") = "" + nRow9("ACARREO SAN JOSE A QUILA") = "ND" + nRow9("PIPER MERIDIAN M500") = "ND" + nRow9("PRESA JALES PEÑA COLORADA") = "ND" + nRow9("MINA LA CRUZ") = "ND" + nRow9("TOGUI -UBER") = "ND" + nRow9("SAN IGNACIO") = "ND" + nRow9("Porcentaje") = "50%" + + nRow10("Numero") = "15" + nRow10("Indicador") = "Relación de entradas de almacén contra órdenes de compra" + nRow10("Comentarios") = "Relación" + nRow10("ACARREO SAN JOSE A QUILA") = "" + nRow10("PIPER MERIDIAN M500") = "" + nRow10("PRESA JALES PEÑA COLORADA") = "" + nRow10("MINA LA CRUZ") = "" + nRow10("TOGUI -UBER") = "" + nRow10("SAN IGNACIO") = "" + nRow10("Porcentaje") = "" + + + DTDatos.Rows.Add(nRow1) + DTDatos.Rows.Add(nRow2) + DTDatos.Rows.Add(nRow3) + DTDatos.Rows.Add(nRow4) + DTDatos.Rows.Add(nRow5) + DTDatos.Rows.Add(nRow6) + DTDatos.Rows.Add(nRow7) + DTDatos.Rows.Add(nRow8) + DTDatos.Rows.Add(nRow9) + DTDatos.Rows.Add(nRow10) + + DTDatos.AcceptChanges() + Return DTDatos + + End Function + Public Sub CargaDatos() LnkExportar.Visible = False - Dim ObjVentas As New ClsVentas - - If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 1) Then - GvDatos.DataSource = ObjVentas.DtResultados - - If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - LnkExportar.Visible = True - End If - Else - GvDatos.DataSource = Nothing - End If - - ObjVentas.Dispose() - + GvDatos.DataSource = CrearTablaDatos() GvDatos.DataBind() + 'LnkExportar.Visible = True + 'GvDatos.DataBind() + + If GvDatos.Rows.Count > 0 Then + LnkExportar.Visible = True + End If UpDatos.Update() End Sub - Public Sub CargaDatosEspeciales() - - LnkExportar.Visible = False - - Dim ObjVentas As New ClsVentas - - If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 2) Then - GvDatosEspeciales.DataSource = ObjVentas.DtResultados - - If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - LnkExportar.Visible = True - End If - Else - GvDatosEspeciales.DataSource = Nothing - End If - - ObjVentas.Dispose() - - GvDatosEspeciales.DataBind() - - UpDatosEspeciales.Update() - - End Sub - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) - - If Tabs.ActiveTabIndex = 0 Then - CargaDatos() - Else - CargaDatosEspeciales() - End If - + CargaDatos() End Sub #Region "EXCEL" @@ -125,16 +234,13 @@ Partial Class OI_RepIndicadoresEMD Dim SbFiltros As New StringBuilder() - SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|") + SbFiltros.AppendFormat($"Ejercicio: {DdlEjercicio.SelectedItem.Text} Periodo: {DdlPeriodo.SelectedItem.Text}|") - If Tabs.ActiveTabIndex = 0 Then - GvDatos.Columns(10).Visible = False - GvDatos.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString()) - GvDatos.Columns(10).Visible = True - Else - GvDatosEspeciales.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones Especiales", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString()) - End If + ' GvDatos.Columns(10).Visible = False + GvDatos.ExportToExcelGembox("IndicadoresEMD", UsuarioActual, "Indicadores EMD", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString()) + ' GvDatos.Columns(10).Visible = True + End Sub @@ -145,107 +251,10 @@ Partial Class OI_RepIndicadoresEMD #End Region - Protected Sub LnkComisiones_Click(sender As Object, e As EventArgs) - CargaComisiones() - RegistraScript("$('#DvModalComisiones').modal('show');") - End Sub - - Private Sub CargaComisiones() - DTDatos = New DataTable - GvComisiones.DataSource = Nothing - - Dim objVentas As New ClsVentas - - If objVentas.GetComisionesMedicas(UsuarioActual.CveEmpresa) Then - GvComisiones.DataSource = objVentas.DtResultados - DTDatos = objVentas.DtResultados - End If - - objVentas.Dispose() - - GvComisiones.DataBind() - - UpDvModalComisiones.Update() - - End Sub - Protected Sub BtnGuardarComisiones_Click(sender As Object, e As EventArgs) - - Dim objVentas As New ClsVentas - objVentas.IniciaTransacSQL() - - Dim TieneError As Boolean = False - - For Each GvRow As GridViewRow In GvComisiones.Rows - - Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero - Dim ComisionMedicoDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionMedico", $"CvePS = {CvePS} ").ToDecimal - Dim ComisionVendedorDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionVendedor", $"CvePS = {CvePS} ").ToDecimal - Dim ComisionTecnicoDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionTecnico", $"CvePS = {CvePS} ").ToDecimal - Dim ComisionGerenteDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionGerente", $"CvePS = {CvePS} ").ToDecimal - - Dim ComisionMedicoGV As Decimal = GvRow.FCTextBox("TxtComisionMedico").Text.ToDecimal - Dim ComisionGerenteGV As Decimal = (GvRow.FCTextBox("TxtComisionGerente").Text.ToDecimal / 100).RoundSQL(4) - Dim ComisionVendedorGV As Decimal = (GvRow.FCTextBox("TxtComisionVendedor").Text.ToDecimal / 100).RoundSQL(4) - Dim ComisionTecnicoGV As Decimal = (GvRow.FCTextBox("TxtComisionTecnico").Text.ToDecimal / 100).RoundSQL(4) - - - If ComisionMedicoDT <> ComisionMedicoGV Or ComisionVendedorDT <> ComisionVendedorGV Or ComisionTecnicoDT <> ComisionTecnicoGV Or ComisionGerenteDT <> ComisionGerenteGV Then - If Not objVentas.AddUpdateComisionesMedicas(GvRow.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, ComisionMedicoGV, ComisionVendedorGV, ComisionTecnicoGV, ComisionGerenteGV) Then - TieneError = True - End If - End If - - Next - - If TieneError Then - objVentas.RollBack() - Else - objVentas.Commit() - Alert("Comisiones Actualizadas correctamente") - End If - - objVentas.Dispose() - - End Sub - - Protected Sub GvComisiones_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - If e.Row.RowType = DataControlRowType.DataRow Then - - 'ComisionMedico,ComisionGerente,ComisionVendedor,ComisionTecnico" - - If e.Row.DataKey("ComisionMedico").ToDecimal = 0 Then - e.Row.FCTextBox("TxtComisionMedico").Text = "" - Else - e.Row.FCTextBox("TxtComisionMedico").Text = e.Row.DataKey("ComisionMedico").ToDecimal.ToString("###.00") - End If - - - If e.Row.DataKey("ComisionGerente").ToDecimal = 0 Then - e.Row.FCTextBox("TxtComisionGerente").Text = "" - Else - e.Row.FCTextBox("TxtComisionGerente").Text = (e.Row.DataKey("ComisionGerente").ToDecimal * 100).ToString("###.00") - End If - - - If e.Row.DataKey("ComisionVendedor").ToDecimal = 0 Then - e.Row.FCTextBox("TxtComisionVendedor").Text = "" - Else - e.Row.FCTextBox("TxtComisionVendedor").Text = (e.Row.DataKey("ComisionVendedor").ToDecimal * 100).ToString("###.00") - End If - - If e.Row.DataKey("ComisionTecnico").ToDecimal = 0 Then - e.Row.FCTextBox("TxtComisionTecnico").Text = "" - Else - e.Row.FCTextBox("TxtComisionTecnico").Text = (e.Row.DataKey("ComisionTecnico").ToDecimal * 100).ToString("###.00") - End If - End If - - End Sub End Class diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs index 277819ec0..52732abc1 100644 --- a/OI/TareaDetalle.aspx.cs +++ b/OI/TareaDetalle.aspx.cs @@ -51,6 +51,12 @@ public partial class OI_TareaDetalle : ClsPaginas public System.Data.DataTable CheckListNew { get { return ViewState["CheckListNew"] != null ? (System.Data.DataTable)ViewState["CheckListNew"] : null; } set { ViewState["CheckListNew"] = value; } } public int chklistitemindex { get { return ViewState["chklistitemindex"] != null ? ViewState["chklistitemindex"].ToString().ToEntero() : 0; } set { ViewState["chklistitemindex"] = value; } } + + public int CveIndicador { get { return ViewState["CveIndicador"].ToString().ToEntero(); } set { ViewState["CveIndicador"] = value; } } + public int Indicador { get { return ViewState["Indicador"].ToString().ToEntero(); } set { ViewState["Indicador"] = value; } } + public int ValorIndicador { get { return ViewState["ValorIndicador"].ToString().ToEntero(); } set { ViewState["ValorIndicador"] = value; } } + public int CveSubProyectoIndicador { get { return ViewState["CveSubProyectoIndicador"].ToString().ToEntero(); } set { ViewState["CveSubProyectoIndicador"] = value; } } + #endregion protected void Page_Load(object sender, EventArgs e) { @@ -72,6 +78,12 @@ public partial class OI_TareaDetalle : ClsPaginas EsNuevo = true; CveUsuarioPara = 0; CveUsuarioDe = 0; + + CveIndicador = -1; + Indicador = -1; + ValorIndicador = -1; + CveSubProyectoIndicador = -1; + if (Request["Archivo"] != null) { string strArchivo = string.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ModExtensiones.Decripta(Request["Archivo"].ToString())); @@ -458,6 +470,11 @@ public partial class OI_TareaDetalle : ClsPaginas //OIE.[CveEventoEstatus], OIE.[FechaInicio], OIE.[FechaFin], OIE.[FechaRealTermino], OIE.[CveRevision], OIE.[Archivo], OIE.[FechaIng], //OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance] + CveIndicador = drow["CveIndicador"].ToString().ToEntero(); + Indicador = drow["Indicador"].ToString().ToEntero(); + ValorIndicador = drow["ValorIndicador"].ToString().ToEntero(); + CveSubProyectoIndicador = drow["CveSubProyectoIndicador"].ToString().ToEntero(); + LtlVinculo.Text = ""; LtlVinculoLink.Text = ""; CveEventoPadre = drow["CveEventoPadre"].ToString().ToEntero(); @@ -1021,8 +1038,15 @@ public partial class OI_TareaDetalle : ClsPaginas using (ClsOIEventos objOI = new ClsOIEventos()) { + objOI.IniciaTransacSQL(); + bool ProcesoOK = false; if (objOI.UpdateEstatusEvento2(CveEstatus, -1, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtComentarioTerminarpadre.Text)) + { + ProcesoOK = true; + } + + if (ProcesoOK) { ObjEventosCorreo o = objOI.objCorreo; if (CveEstatus >= 3) @@ -1033,31 +1057,22 @@ public partial class OI_TareaDetalle : ClsPaginas { pnlfecharealtermino.Visible = false; } - //CargaEstatusEventos(DdlEventoEstatus.SelectedValue.ToEntero); - //if (DdlEventoEstatus.SelectedValue.ToEntero == 3 | DdlEventoEstatus.SelectedValue.ToEntero == 1) - // EnviarCorreoCambioEstatus(false); - //CargaDatos(); if (CveEstatus == 4) { TxtAvance.Text = "100"; LblPorcentaje.Text = string.Format("{0:##0.##}", "100".ToDecimal()); - } - string mensaje = string.Format("Se cambió el Estatus de \"{0}\" a \"{1}\"", DdlEventoEstatus.SelectedItem.Text, DDlEstatus.SelectedItem.Text); - DdlEventoEstatus.SelectedValueExist(DDlEstatus.SelectedValue); - lblEstatus.Text = DdlEventoEstatus.SelectedItem.Text; - UpEstatus.Update(); - RegistraScript(string.Format("$('#{0}').modal('hide')", iddivCambiarEstatus)); - Alert(mensaje, ModExtensiones.TipoMensaje.ToastInformacion); - cargaActividades(objOI); + } string Nombrede = ""; string Nombrepara = ""; + System.Data.DataTable dt = get_GlobalDTUsuarios(CveUsuario: CveUsuarioDe, CveEmpresa: UsuarioActual.CveEmpresa); if (dt.Rows.Count > 0) { Nombrede = dt.Rows[0]["Nombre"].ToString(); } + dt = get_GlobalDTUsuarios(CveUsuario: CveUsuarioDe, CveEmpresa: UsuarioActual.CveEmpresa); if (dt.Rows.Count > 0) { @@ -1068,10 +1083,46 @@ public partial class OI_TareaDetalle : ClsPaginas DateTime FFin = txtFechaF.Text.ToDateTimeExcat(); if (o != null) { - string mailbody = MailgetBodyNuevatarea(o.Folio, o.Link, o.Asunto, o.Descripcion, fInicio,FFin, o.Prioridad, o.Tema, Nombrede, Nombrepara, string.Format("Tarea Estatus Actualizado ({0})", o.Estatus)); + string mailbody = MailgetBodyNuevatarea(o.Folio, o.Link, o.Asunto, o.Descripcion, fInicio, FFin, o.Prioridad, o.Tema, Nombrede, Nombrepara, string.Format("Tarea Estatus Actualizado ({0})", o.Estatus)); EnviarCorreo(UsuarioActual.Empresa, o.AsuntoCorreo, mailbody, o.mailPara, ""); } + } + if (ProcesoOK && CveIndicador > 0 && (DDlEstatus.SelectedValue.ToEntero() == 3 || DDlEstatus.SelectedValue.ToEntero() == 4)){ + if(Indicador == 1) + { + int Valor = 0; + int dias = (int) (txtFechaF.Text.ToDate() - NowADS()).TotalDays; + if (dias >= -2) + { + Valor = 1; + } + + if (!objOI.UpdateIndicador(CveIndicador, Valor, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + ProcesoOK = false; + } + } + } + + if (ProcesoOK){ + + cargaActividades(objOI); + + objOI.Commit(); + + string mensaje = string.Format("Se cambió el Estatus de \"{0}\" a \"{1}\"", DdlEventoEstatus.SelectedItem.Text, DDlEstatus.SelectedItem.Text); + DdlEventoEstatus.SelectedValueExist(DDlEstatus.SelectedValue); + lblEstatus.Text = DdlEventoEstatus.SelectedItem.Text; + UpEstatus.Update(); + RegistraScript(string.Format("$('#{0}').modal('hide')", iddivCambiarEstatus)); + + Alert(mensaje, ModExtensiones.TipoMensaje.ToastInformacion); + + + } + else{ + objOI.RollBack(); } } diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index 2d01f9a80..86deadc43 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -269,7 +269,7 @@
    - Observaciones
    -
    diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index a2ecaae35..38edd3696 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -696,8 +696,13 @@ $('#<%=TxtObservaciones.ClientID%>').val(event.title); $('#<%=TxtDescripcion.ClientID%>').val(event.title); $('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento); - $('#<%=TxtFechaSalida.ClientID%>').val(event.start._i); - $('#<%=TxtFechaRegreso.ClientID%>').val(event.end._i); + + <%--$('#<%=TxtFechaSalida.ClientID%>').val(event.start._i); + $('#<%=TxtFechaRegreso.ClientID%>').val(event.end._i);--%> + + $('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start._i)); + $('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal)); + $('#<%=DdlClientes.ClientID%>').val(event.CveCliente); $('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo); $('#<%=DdlChofer.ClientID%>').val(event.CvePersonal); @@ -720,6 +725,30 @@ $('#<%=BtnModal.ClientID%>').click(); } + + function formatearFechaISO(fechaISO) { + let fecha = new Date(fechaISO); + + // Formatear la fecha en DD/MM/YYYY + let dia = fecha.getDate().toString().padStart(2, '0'); + let mes = (fecha.getMonth() + 1).toString().padStart(2, '0'); // getMonth() devuelve mes de 0-11 + let año = fecha.getFullYear(); + + // Formatear la hora en formato 12 horas con AM/PM + let horas = fecha.getHours(); + let minutos = fecha.getMinutes().toString().padStart(2, '0'); + let periodo = 'a. m.'; + if (horas >= 12) { + periodo = 'p. m.'; + horas = horas > 12 ? horas - 12 : horas; // Convertir hora de formato 24 a 12 horas + } + if (horas === 0) horas = 12; // Medianoche se muestra como 12 a.m. + horas = horas.toString().padStart(2, '0'); + + // Combinar la fecha y la hora + return `${dia}/${mes}/${año} ${horas}:${minutos}:00 ${periodo}`; + } + function RadionButtonSelectedValueSet(name, SelectdValue) { $('input[name="' + name + '"][value="' + SelectdValue + '"]').prop('checked', true); } @@ -824,6 +853,8 @@ }); } + +