From 5eab7f83dbdc2837d08e4a2b6983aa727dde62ac Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 7 May 2024 19:38:32 -0700 Subject: [PATCH 1/9] =?UTF-8?q?--Tama=C3=B1o=20de=20diagrama=20segun=20la?= =?UTF-8?q?=20cantidad=20de=20datos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Transportes/RepContratosCalendario.aspx | 79 +++++++++++----------- Transportes/RepContratosCalendario.aspx.vb | 2 +- 2 files changed, 39 insertions(+), 42 deletions(-) diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index aa7504d5c..a2ecaae35 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -21,7 +21,7 @@ #chartdiv { width: 100%; - height: 700px; + height: 600px; } @@ -280,36 +280,33 @@ - - -
-
-
- -
-
-
- - -
- - - - + +
+
+
+ +
+
+
+ +
+ + + + +
+
-
-
- - + +
-
+
- @@ -526,7 +523,6 @@ "February": "Febrero", "March": "Marzo", "April": "Abril", - "May": "Mayo", "June": "Junio", "July": "Julio", "August": "Agosto", @@ -537,7 +533,7 @@ }; - function cargaDiagramaGrant(data, categorias) { + function cargaDiagramaGrant(data, categorias, TipoVista) { am5.ready(function () { //SI YA HAY GRAFICA, QUITA LA ACTUAL PARA HACER UNA NUEVA @@ -566,7 +562,7 @@ layout: root.verticalLayout, paddingLeft: 0 })); - + // Add legend // https://www.amcharts.com/docs/v5/charts/xy-chart/legend-xy-series/ var legend = chart.children.push(am5.Legend.new(root, { @@ -650,23 +646,24 @@ chart.set("scrollbarY", scrollbarY); - /// evento para ajustar el alto del row - var cellSize = 30; - chart.events.on("datavalidated", function (ev) { + + series.events.on("datavalidated", function (ev) { + let cellSize = 45; - // Get objects of interest - var chart = ev.target; - var categoryAxis = chart.yAxes.getIndex(0); + if (TipoVista == 1) { + cellSize = 60; + } + //let series = ev.target; + //let chart = series.chart; + let xAxis = chart.xAxes.getIndex(0); // Calculate how we need to adjust chart height - var adjustHeight = chart.data.length * cellSize - categoryAxis.pixelHeight; - - // get current chart height - var targetHeight = chart.pixelHeight + adjustHeight; + let chartHeight = categorias.length * cellSize + xAxis.height() + chart.get("paddingTop", 0) + chart.get("paddingBottom", 0); // Set it on chart's container - chart.svgContainer.htmlElement.style.height = targetHeight + "px"; + chart.root.dom.style.height = chartHeight + "px"; }); + //root.language.setTranslationAny("May", "Mayo"); // Make stuff animate on load // https://www.amcharts.com/docs/v5/concepts/animations/ @@ -713,12 +710,12 @@ if (event.NombreComercial !== null) { - $('#HidModClienteNombre').val(''); + $('#HidModClienteNombre').val(''); } else { $('#HidModClienteNombre').val(event.NombreComercial); - } + } - $('#HidModCveCliente').val(event.CveCliente); + $('#HidModCveCliente').val(event.CveCliente); $('#<%=BtnModal.ClientID%>').click(); } diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index 81f09aa7f..bff2a01e6 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -103,7 +103,7 @@ Partial Class RepContratosCalendario jsonCategorias.Add(obj) Next - RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()});", "A1") + RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});", "A1") UPPGantt.Update() End If End Sub From c2dc285525615088d49e9706649334712434dc40 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 7 May 2024 23:09:07 -0700 Subject: [PATCH 2/9] Proyectos --- App_Code/ClsOIEventos.vb | 62 ++++++- App_Code/ClsPaginas.vb | 1 + OI/Proyecto.aspx | 23 +++ OI/Proyecto.aspx.cs | 67 +++++++- OI/RepIndicadoresEMD.aspx | 306 +++++++++++++++++++++++++++++++++++ OI/RepIndicadoresEMD.aspx.vb | 251 ++++++++++++++++++++++++++++ 6 files changed, 703 insertions(+), 7 deletions(-) create mode 100644 OI/RepIndicadoresEMD.aspx create mode 100644 OI/RepIndicadoresEMD.aspx.vb diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 9e64639a3..43dadaa3d 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -87,6 +87,7 @@ Public Class ClsOIEventos End Property #Region "Propiedades de la tabla OI_Eventos" Public Property CveEvento As Integer + Public Property CveIndicador As Integer Public Property CveTipoEvento As Integer Public Property Folio As Integer Public Property TipoEvento As String @@ -965,7 +966,7 @@ Public Class ClsOIEventos Optional CveOS As Integer = -1, Optional CveOC As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveContrato As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CorreoExterno As String = "", Optional CveTableroLista As Integer = -1, Optional Lugar As String = "", - Optional Asistencia As String = "", Optional Duracion As String = "", Optional CveAcercamiento As Integer = -1) As Boolean + Optional Asistencia As String = "", Optional Duracion As String = "", Optional CveAcercamiento As Integer = -1, Optional CveIndicador As Integer = -1) As Boolean Dim retorno As Boolean = False Dim xmlMiembros As System.Xml.Linq.XDocument = Nothing @@ -1028,6 +1029,7 @@ Public Class ClsOIEventos .Add("@Lugar", SqlDbType.VarChar).Value = Lugar .Add("@CveTableroLista", SqlDbType.VarChar).Value = CveTableroLista .Add("@CveAcercamiento", SqlDbType.VarChar).Value = CveAcercamiento + .Add("@CveIndicador", SqlDbType.VarChar).Value = CveIndicador '.Add("@mailPara", SqlDbType.VarChar).Direction = ParameterDirection.Output @@ -3216,8 +3218,66 @@ Public Class ClsOIEventos Return Retorno End Function + #End Region + + +#Region "I N D I C A D O R E S " + +#End Region + + Public Function AddIndicador(Indicador As Integer, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + CveIndicador = -1 + + DataAdapter("PA_Dir_IndicadorAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Indicador", SqlDbType.Int).Value = Indicador + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveIndicador", SqlDbType.Int).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + CveIndicador = SqlAdapter.SelectCommand.Parameters("@CveIndicador").Value.ToString().ToEntero() + If CveIndicador > 0 Then + Retorno = True + End If + + Catch ex As Exception + OnError("Ocurrió un error al agregar el indicador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateIndicador(CveIndicador As Integer, Valor As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Dir_IndicadorUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveIndicador", SqlDbType.Int).Value = CveIndicador + .Add("@Valor", SqlDbType.Int).Value = Valor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el indicador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + #End Region ' IDisposable diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 2e23ed098..fec7d95dc 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10517,6 +10517,7 @@ Public Class ClsPaginas PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), -1) PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), -1) PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/RepIndicadoresEMD.aspx".ToUpper(), 1348) #End Region #Region "Planeacion" PaginaDict.Add("/Planeacion/CatSucursales.aspx".ToUpper(), 17) diff --git a/OI/Proyecto.aspx b/OI/Proyecto.aspx index 42b64e86c..a0ce32782 100644 --- a/OI/Proyecto.aspx +++ b/OI/Proyecto.aspx @@ -246,6 +246,29 @@
+ +
+
+
+ + + Programación de bolsa aprobada en tiempo + + Indicador: +
+
+
+
+ + + + + : + +
+
+ +
diff --git a/OI/Proyecto.aspx.cs b/OI/Proyecto.aspx.cs index 2c4d1eaba..7cc797d2b 100644 --- a/OI/Proyecto.aspx.cs +++ b/OI/Proyecto.aspx.cs @@ -48,7 +48,22 @@ public partial class OI_Proyecto : ClsPaginas DdlTema.DataBind(); DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); - + CargarCentrosDeCosto(null, DdlSubProyecto, null, LblSubProyecto, ""); + + if (DdlSubProyecto.Items.Count > 0) + { + DdlSubProyecto.Items.RemoveAt(0); + DdlSubProyecto.Items.Insert(0, new ListItem("Seleccione","-1")); + } + + + if (UsuarioActual.CveEmpresa == 13) + { + DvIndicador.Visible = true; + } + + + } } @@ -184,6 +199,7 @@ public partial class OI_Proyecto : ClsPaginas bool Continuar = false; int Folio = -1; int CveEvento = -1; + int CveIndicador = -1; if (cveUsuarioDe <= 0) { @@ -193,24 +209,59 @@ public partial class OI_Proyecto : ClsPaginas if (cveUsuarioPara <= 0) { errorMessage = "No se selecciono el miembro 'Para'"; - } + + if(DdlIndicador.SelectedValue.ToEntero() > 0 && DdlSubProyecto.SelectedValue.ToEntero() <0) + { + errorMessage = "Si agrega un indicador debe de agregar el sub proyecto."; + } + if (errorMessage.Length == 0) { List chkList = new List(); - + using (ClsOIEventos objOI = new ClsOIEventos()) { objOI.IniciaTransacSQL(); - Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEventoB); + + + if (DdlIndicador.SelectedValue.ToEntero() > 0) + { + + if (objOI.AddIndicador(DdlIndicador.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa) && objOI.CveIndicador > 0) + { + CveIndicador = objOI.CveIndicador; + Continuar = true; + } + else + { + Continuar = false; + } + } + else + { + Continuar = true; + } + + + if (Continuar) + { + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEventoB, CveIndicador: CveIndicador); + } CveEvento = objOI.CveEvento; Folio = objOI.Folio; - if (CveEvento == 0) + + if (CveEvento > 0) + { + Continuar = true; + } + else { Continuar = false; } + if (Continuar) { objOI.Commit(); @@ -249,13 +300,17 @@ public partial class OI_Proyecto : ClsPaginas txtFechaI.Text = ""; } } + else + { + Alert(errorMessage,ModExtensiones.TipoMensaje.MsgAdvertencia); + } } protected void BtnopenmodalClickGant_Click(object sender, EventArgs e) { - + SetUsuarios(); RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarProyecto)); RCveEventoB = txtCveEvento.Text.ToEntero(); } diff --git a/OI/RepIndicadoresEMD.aspx b/OI/RepIndicadoresEMD.aspx new file mode 100644 index 000000000..3cb62f323 --- /dev/null +++ b/OI/RepIndicadoresEMD.aspx @@ -0,0 +1,306 @@ +<%@ Page Title="Reporte de Indicadores" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadoresEMD.aspx.vb" Inherits="OI_RepIndicadoresEMD" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> +<%@ Register Src="~/UserControl/AddMedico.ascx" TagPrefix="UserControl" TagName="AddMedico" %> + + + + + + Reporte de Comisiones + + + + + Reporte de Comisiones + + + + + +
  • + +
  • +
  • + Excel +
  • +
    + + + +
    + +
    + + + + + +
    +
    +
    + + +
    +
    +
    + + +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: + +
    +
    +
    + + + + +
    + + + + + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    + + + +
    +
    +
    + +
    +
    +
    + + + + + + + + +
    + " 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 new file mode 100644 index 000000000..366cd4397 --- /dev/null +++ b/OI/RepIndicadoresEMD.aspx.vb @@ -0,0 +1,251 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones + + +Partial Class OI_RepIndicadoresEMD + Inherits ClsPaginas + + Property DTDatos As DataTable + Get + If ViewState("DTDatos") Is Nothing Then + ViewState("DTDatos") = New DataTable + End If + Return DirectCast(ViewState("DTDatos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DTDatos") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + 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")) + + + + End Sub + + 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.DataBind() + + 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 + + End Sub + +#Region "EXCEL" + + Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + + + Dim SbFiltros As New StringBuilder() + SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.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 + + + End Sub + + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub + +#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 From bc785a03fa1037b583f19936b26aa8789d5ac2ee Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 8 May 2024 17:58:46 -0700 Subject: [PATCH 3/9] --FIX limitacion de saldos en aplicacion de NC con RNC --- Ventas/Ventas.aspx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index acf2e7a94..d8e402683 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -9619,10 +9619,11 @@ TxtImporte.value = FormatoNumero(ImporteRestante, 2); $get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + ToDouble(TxtImporte.value), 2); }else { - $get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2); + $get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2); + TxtImporte.value = FormatoNumero(Importe, 2); } - if (ToDouble(TxtImporte.value) <= 0) { + if (ToDouble(TxtImporte.value.replace(",", "")) <= 0) { Chk.checked = false; } From 0877fa128e182e3998cad7d8904f0b368690bf9a Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 8 May 2024 18:15:08 -0700 Subject: [PATCH 4/9] =?UTF-8?q?--SMS.=20Definici=C3=B3n=20de=20reporte=20d?= =?UTF-8?q?e=20estatus=20de=20OS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 19 +++++++++++++++++++ App_Code/ClsOS.vb | 28 ++++++++++++++++++++++++---- App_Code/ClsPaginas.vb | 1 + OS/RepOSEstatus.aspx | 19 +++++++++++++++++++ OS/RepOSEstatus.aspx.vb | 5 +++++ 5 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 OS/RepOSEstatus.aspx create mode 100644 OS/RepOSEstatus.aspx.vb diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index fa47212e6..cb986fc36 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -4469,6 +4469,25 @@ Public Class ClsInventarios Return Retorno End Function + Public Function UpdateOSEstatusInventario(CveOS As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OS_OSEstatusInventarioUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOS", SqlDbType.Int).Value = CveOS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus de OS.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function #End Region #Region " INVENTARIOS - SOLICITUD DE TRASPASOS " diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index b2f8c1d29..376513ad8 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -458,12 +458,12 @@ Public Class ClsOS End Try Return Retorno - End Function - + End Function + #End Region - + #Region "ClsOSOrdenesServicios" - 'Reporte de Ventas + 'Reporte de Ventas Public Function GetRepOrdenesServicio(FechaI As Date, FechaF As Date, FechaTerminado As String, CveCliente As Integer, CveSubProyecto As Integer, CveUsuarioRecibio As Integer, CveTecnico As Integer, CveEstatusOrdenServicio As Integer, CveEmpresa As Integer, Optional Opcion As Integer = -1, Optional CveUsuarioAsignado As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -492,6 +492,26 @@ Public Class ClsOS OnError("Ocurrió un error al obtener el Reporte de Ordenes de Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + Return Retorno + End Function + + Public Function GetRepOSEstatus(CveOS As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OS_OSEstatusRepGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOS", SqlDbType.Int).Value = CveOS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Reporte de estatus de OS.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno End Function diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 2e23ed098..2ada13980 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10463,6 +10463,7 @@ Public Class ClsPaginas PaginaDict.Add("/OS/Asignaciones.aspx".ToUpper(), 125) PaginaDict.Add("/OS/RepServicioDomicilio.aspx".ToUpper(), 1330) PaginaDict.Add("/OS/RepOSMedicas.aspx".ToUpper(), 1345) + PaginaDict.Add("/OS/RepOSEstatus.aspx".ToUpper(), 1349) #End Region #Region "OC" PaginaDict.Add("/OC/OC.aspx".ToUpper(), 155) diff --git a/OS/RepOSEstatus.aspx b/OS/RepOSEstatus.aspx new file mode 100644 index 000000000..a04d48792 --- /dev/null +++ b/OS/RepOSEstatus.aspx @@ -0,0 +1,19 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOSEstatus.aspx.vb" Inherits="OS_RepOSEstatus" %> + + + + + + + + + + + + + + + + + + diff --git a/OS/RepOSEstatus.aspx.vb b/OS/RepOSEstatus.aspx.vb new file mode 100644 index 000000000..80b2766b1 --- /dev/null +++ b/OS/RepOSEstatus.aspx.vb @@ -0,0 +1,5 @@ + +Partial Class OS_RepOSEstatus + Inherits System.Web.UI.Page + +End Class From 2eb2ee90ef1448f23e1024e600a8a387ba608eb9 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 9 May 2024 12:54:05 -0700 Subject: [PATCH 5/9] BDH. Bloqueo de facturacion por vencimiento --- Ventas/Ventas.aspx.vb | 151 ++++++++++++++++++++++++++++++------------ 1 file changed, 108 insertions(+), 43 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ef6c31f2f..8a04f4559 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2289,6 +2289,15 @@ Partial Class Ventas End Set End Property + Private Property TieneBloqueoPorCreditoVencimiento As Integer + Get + Return IfNull(ViewState("TieneBloqueoPorCreditoVencimiento"), "0", ViewState("TieneBloqueoPorCreditoVencimiento")).ToString().ToEntero() + End Get + Set(value As Integer) + ViewState("TieneBloqueoPorCreditoVencimiento") = value + End Set + End Property + Private Property EsNCDevolucionEfectivo As Boolean Get Return If(IsNothing(ViewState("EsNCDevolucionEfectivo")), False, CType(ViewState("EsNCDevolucionEfectivo"), Boolean)) @@ -2442,6 +2451,8 @@ Partial Class Ventas Me.CveVendedorContrato = -1 Me.CveVendedorEmpresaCRM = -1 Me.EsGarantia = False + Me.TieneBloqueoPorCreditoVencimiento = 0 + Me.ClienteEsDistribuidor = False CveEmpresaCRM = 0 CveAcercamientoCRM = 0 EstatusCliente = False @@ -5908,7 +5919,7 @@ Partial Class Ventas End If 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR - If TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad") Then + If (TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad")) AndAlso TieneBloqueoPorCreditoVencimiento = 0 Then BtnsFacturar.Visible = True 'E119, bloquear la facturación de remisiones que no estén surtidas @@ -5938,48 +5949,51 @@ Partial Class Ventas 'Si es Empresa de Acumuladores If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Rem" AndAlso (GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() <> 5) Then - BtnsFacturar.Visible = False - - Dim DtUsadosPendientes As DataTable = Nothing - Dim DtGarantiasPendientes As DataTable = Nothing - - Dim ObjUsados As New ClsVentas - - If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then - DtUsadosPendientes = ObjUsados.DtResultados.Copy() - End If - - If ObjUsados.GetVentasGarantiaPendiente(CveVenta, NowADS(), UsuarioActual.CveEmpresa) Then - DtGarantiasPendientes = ObjUsados.DtResultados.Copy() - End If - - 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, NowADS(), UsuarioActual.CveEmpresa) Then - ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy() - 'End If - - ObjUsados.Dispose() - - BtnsFacturar.Visible = True - - 'VERIFICA SI YA SE FACTURO COMPLETAMENTE - If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then + If TieneBloqueoPorCreditoVencimiento = 0 Then BtnsFacturar.Visible = False - End If - 'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES - If BtnsFacturar.Visible Then - If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then - BtnsFacturar.Visible = False - Alert("Tiene usados pendiente de recibir", TipoMensaje.MsgAdvertencia) + Dim DtUsadosPendientes As DataTable = Nothing + Dim DtGarantiasPendientes As DataTable = Nothing + + Dim ObjUsados As New ClsVentas + + If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then + DtUsadosPendientes = ObjUsados.DtResultados.Copy() End If - If (EsGarantia AndAlso (DtGarantiasPendientes IsNot Nothing AndAlso DtGarantiasPendientes.Rows.Count > 0)) Then - Alert("Tiene garantías pendientes de recibir", TipoMensaje.MsgAdvertencia) + If ObjUsados.GetVentasGarantiaPendiente(CveVenta, NowADS(), UsuarioActual.CveEmpresa) Then + DtGarantiasPendientes = ObjUsados.DtResultados.Copy() + End If + + 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, NowADS(), UsuarioActual.CveEmpresa) Then + ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy() + 'End If + + ObjUsados.Dispose() + + BtnsFacturar.Visible = True + + 'VERIFICA SI YA SE FACTURO COMPLETAMENTE + If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then BtnsFacturar.Visible = False End If + + 'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES + If BtnsFacturar.Visible Then + If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then + BtnsFacturar.Visible = False + Alert("Tiene usados pendiente de recibir", TipoMensaje.MsgAdvertencia) + End If + + If (EsGarantia AndAlso (DtGarantiasPendientes IsNot Nothing AndAlso DtGarantiasPendientes.Rows.Count > 0)) Then + Alert("Tiene garantías pendientes de recibir", TipoMensaje.MsgAdvertencia) + BtnsFacturar.Visible = False + End If + End If + + LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) End If - LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) End If 'SI ES COMPLEMENTARIA, NO DEBE PERMITIR FACTURAR @@ -6074,7 +6088,7 @@ Partial Class Ventas CargaPS(-1, DdlPS) 'Verifico si tiene la funcionalidad (135) - If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then + If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso TieneBloqueoPorCreditoVencimiento = 0 Then Select Case UsuarioActual.Empresa.Funcionalidad(135) Case "1" ' POR SUPERVISOR @@ -7593,7 +7607,7 @@ Partial Class Ventas If Not EsCreaApartirDe AndAlso (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then DdlTipoComprobante.SelectedValueExist("Cot") Else - If UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then + If UsuarioActual.Empresa.Funcionalidad(595) = "1" Then DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización") DdlTipoComprobante.SelectedValue = "PA" @@ -7614,9 +7628,19 @@ Partial Class Ventas DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem")) End If + Dim Bloqueo As Boolean = False + + If Not DdlTipoComprobante.SelectedValue.Contiene("PA") AndAlso UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then + Bloqueo = True + End If + + 'SI EL CLIENTE ES DISTRIBUIDOR Y TIENE FACTURAS VENCIDAS, DEBE BLOQUEAR + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion = 2 Then + Bloqueo = True + End If 'SI ES AUTORIZACION DEBE PERMITIR GENERARLA - If (Not DdlTipoComprobante.SelectedValue.Contiene("PA")) AndAlso UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then + If Bloqueo Then BtnEmitirImprimir.Visible = False BtnsFacturar.Visible = False LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) @@ -7624,6 +7648,11 @@ Partial Class Ventas LnkPedido2SinFacturar.Visible = False LnkCotizaciones.Visible = False LnkOCs.Visible = False + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + TieneBloqueoPorCreditoVencimiento = 1 + End If + End If If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then @@ -7648,6 +7677,7 @@ Partial Class Ventas 'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO If Autorizacion > 0 Then BtnsFacturar.Visible = True + TieneBloqueoPorCreditoVencimiento = 0 End If End If @@ -7691,6 +7721,7 @@ Partial Class Ventas 'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO If Autorizacion > 0 Then BtnsFacturar.Visible = True + TieneBloqueoPorCreditoVencimiento = 0 End If End If @@ -7761,6 +7792,10 @@ Partial Class Ventas BtnsFacturar.Visible = False BtnGenerarRemision.Visible = False Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + TieneBloqueoPorCreditoVencimiento = 1 + End If End If End If End If @@ -7797,6 +7832,9 @@ Partial Class Ventas BtnsFacturar.Visible = False BtnGenerarRemision.Visible = False Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + TieneBloqueoPorCreditoVencimiento = 1 + End If End If End If @@ -7825,13 +7863,32 @@ Partial Class Ventas 'VERIFICAR RESTRICCIONES DEL CLIENTE If Not UsuarioActual.Empresa.Funcionalidad(702).ToEntero() > 0 Then - If (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2") Then - Dim Valida As Boolean = True - If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (Me.CveCliente = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() OrElse Me.PermiteCredito) Then - Valida = False + + Dim ValidaRemision As Boolean = False + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + ValidaRemision = True + End If + + Dim ValidaCondicionesCredito As Boolean = False + + 'SI ES UNA VENTA EXISTENTE + If CveVenta > 0 Then + If (DdlTipoComprobante.SelectedValue = "Cot") AndAlso RBLPago.SelectedValue = "2" Then + ValidaCondicionesCredito = True End If - If Valida Then + If (ValidaRemision AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then + ValidaCondicionesCredito = True + End If + End If + + If ValidaCondicionesCredito Then + Dim ValidaCliente As Boolean = True + If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (Me.CveCliente = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() OrElse Me.PermiteCredito) Then + ValidaCliente = False + End If + + If ValidaCliente Then Dim Vta As New ClsVentas Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa) Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

    {0}", Vta.SerieVenta) @@ -7861,6 +7918,10 @@ Partial Class Ventas Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) BtnsFacturar.Visible = False BtnGenerarRemision.Visible = False + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + TieneBloqueoPorCreditoVencimiento = 1 + End If End If Else @@ -7868,6 +7929,10 @@ Partial Class Ventas Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) BtnsFacturar.Visible = False BtnGenerarRemision.Visible = False + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + TieneBloqueoPorCreditoVencimiento = 1 + End If End If End If End If From 236e3437225529db209139f9ea4035b6a880b4e7 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 9 May 2024 12:54:50 -0700 Subject: [PATCH 6/9] --BDH. Si es plantilla personalizada, permitir IE con importe 0 --- Contabilidad/RegPrePolizaS.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2908f46f6..ae28bb9d7 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1021,7 +1021,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If 'Registra movimieno bancario - If gvr.DataKey("CveConceptoContable") = "30" AndAlso Importe <> 0 Then + If gvr.DataKey("CveConceptoContable") = "30" AndAlso (Importe <> 0 OrElse DdlPlantilla.SelectedValue = "53") Then Dim tFolio As String = gvr.DataKey("ContadoNumeroFolio").ToString If tFolio.ToEntero = 0 Then tFolio = SiguienteFolioBancos(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero) From 18898125d7d532497cd9a7eca69bf43cbc209a07 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 9 May 2024 14:34:17 -0700 Subject: [PATCH 7/9] --FIX condiciones de credito --- Ventas/Ventas.aspx.vb | 78 +++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 8a04f4559..d08a8016b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6199,14 +6199,13 @@ Partial Class Ventas End Function Private Sub VerificarBtnFacturarCotizacion(CveVendedor As Integer, Optional MostrarGenerarRemision As Boolean = True) - If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then + If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TieneBloqueoPorCreditoVencimiento = 0 Then If UsuarioActual.TienePermisoProceso(199) Then BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) Else BtnGenerarRemision.Visible = False End If - If UsuarioActual.TienePermisoProceso(60) Then BtnsFacturar.Visible = True 'puede facturar If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.TienePermisoProceso(60) Then @@ -7635,7 +7634,7 @@ Partial Class Ventas End If 'SI EL CLIENTE ES DISTRIBUIDOR Y TIENE FACTURAS VENCIDAS, DEBE BLOQUEAR - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion = 2 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then Bloqueo = True End If @@ -7793,7 +7792,7 @@ Partial Class Ventas BtnGenerarRemision.Visible = False Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then TieneBloqueoPorCreditoVencimiento = 1 End If End If @@ -7811,48 +7810,39 @@ Partial Class Ventas End If ObjVentas.Dispose() Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO - 'RMF. codigo temporal para pruebas - If Alertas AndAlso UsuarioActual.CveEmpresa = 140 Then + 'VERIFICAR CANDADOS DE VENTA + If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 Then Dim Vta As New ClsVentas Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa) Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

    {0}", Vta.SerieVenta) Vta.Dispose() If Opcion > 0 Then - LnkSolicitarCredito.Visible = True + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then + TieneBloqueoPorCreditoVencimiento = 1 + End If End If + End If + + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + RBLPago.SelectedValue = "2" + RBLPago.Items(0).Enabled = False + RBLPago_SelectedIndexChanged(Nothing, Nothing) + UPCondicionesPago.Update() Else - 'VERIFICAR CANDADOS DE VENTA - If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 Then - Dim Vta As New ClsVentas - Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa) - Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

    {0}", Vta.SerieVenta) - Vta.Dispose() - If Opcion > 0 Then - BtnsFacturar.Visible = False - BtnGenerarRemision.Visible = False - Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - TieneBloqueoPorCreditoVencimiento = 1 - End If + 'este codigo no es temporal + If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + LnkSolicitarCredito.Visible = True + DdlTipoAutorizacion.SelectedValueExist("1") + + If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then + BtnEmitirImprimir.Visible = False + TieneBloqueoPorCreditoVencimiento = 1 End If End If - - If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then - RBLPago.SelectedValue = "2" - RBLPago.Items(0).Enabled = False - RBLPago_SelectedIndexChanged(Nothing, Nothing) - UPCondicionesPago.Update() - Else - 'este codigo no es temporal - If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) - If UsuarioActual.CveEmpresa = 140 Then - LnkSolicitarCredito.Visible = True - DdlTipoAutorizacion.SelectedValueExist("1") - End If - End If - - End If End Select @@ -7877,7 +7867,7 @@ Partial Class Ventas ValidaCondicionesCredito = True End If - If (ValidaRemision AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then + If (ValidaRemision AndAlso DdlTipoComprobante.SelectedValue = "Rem") AndAlso RBLPago.SelectedValue = "1" Then ValidaCondicionesCredito = True End If End If @@ -7919,7 +7909,7 @@ Partial Class Ventas BtnsFacturar.Visible = False BtnGenerarRemision.Visible = False - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then TieneBloqueoPorCreditoVencimiento = 1 End If End If @@ -7930,7 +7920,7 @@ Partial Class Ventas BtnsFacturar.Visible = False BtnGenerarRemision.Visible = False - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then TieneBloqueoPorCreditoVencimiento = 1 End If End If @@ -18000,7 +17990,7 @@ Partial Class Ventas TrAlmacenOrigen.Visible = False If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then - Alert("Se ocupa una autorización.", TipoMensaje.MsgAdvertencia) + Alert("Se requiere una autorización.", TipoMensaje.MsgAdvertencia) TrDireccion.Visible = False TrCiudad.Visible = False TrRFC.Visible = False @@ -18395,14 +18385,14 @@ Partial Class Ventas If Not CveEmpresaCRM > 0 Then 'SI ES UNA REMISION EXISTENTE, NO MOSTRAR LOS BOTONES If Not (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then - BtnCrearApartirDe.Enabled = EstatusCliente - BtnEmitirImprimir.Visible = EstatusCliente + BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0 + BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0 TrVistaPrevia.Visible = EstatusCliente End If Else If TipoDoctoConsulta.Contiene("Ing", "Egs", "Ant", "Dev") Then - BtnCrearApartirDe.Enabled = EstatusCliente - BtnEmitirImprimir.Visible = EstatusCliente + BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0 + BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0 TrVistaPrevia.Visible = EstatusCliente Else BtnCrearApartirDe.Enabled = True From 6a1bfc0893ee235ab8afb89b9f9fd50441659686 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 9 May 2024 16:48:23 -0700 Subject: [PATCH 8/9] 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 @@ }); } + + From ac8a4008bda116a4445c7747dd69fb48a67c5492 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 10 May 2024 00:41:07 -0700 Subject: [PATCH 9/9] --fix autorizaciones y caja chica en transferencias --- Ventas/Ventas.aspx.vb | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d08a8016b..e6c594ee8 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -7834,13 +7834,36 @@ Partial Class Ventas Else 'este codigo no es temporal If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then LnkSolicitarCredito.Visible = True DdlTipoAutorizacion.SelectedValueExist("1") If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then - BtnEmitirImprimir.Visible = False - TieneBloqueoPorCreditoVencimiento = 1 + Dim Autorizacion As Integer = 0 + + Dim ObjVentas As New ClsVentas + If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then + Dim RowAutorizacion As DataRow = Nothing + 'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO + If TieneDiasVencidos Then + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") + Else + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") + End If + + If RowAutorizacion IsNot Nothing Then + Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero() + End If + End If + ObjVentas.Dispose() + + 'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO + If Autorizacion <= 0 Then + BtnEmitirImprimir.Visible = False + TieneBloqueoPorCreditoVencimiento = 1 + End If + End If End If End If @@ -23441,8 +23464,11 @@ Partial Class Ventas ' DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) 'End If - DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) - + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0}", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + Else + DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + End If DtCC.Dispose() DdlCuentaEfectivo.DataBind()