diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index a593378e5..c926a33b8 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -917,7 +917,14 @@ Public Class Timbrado .NumParcialidad = VentaNumParcialidad, .ObjetoImpuesto = ObjetoImpuesto} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)} - For Each drp As DataRow In dttpagosimpuestos.FiltraParametros(String.Format("FolioFiscal = '{0}'", VentaFolioFiscal.ToLower)).Rows + + 'dtTempdttpagosimpuestos se esta usando para el caso de que el objeto de impuesto del ps de la venta sea 01 (la consulta por default genera 02) + Dim dtTempdttpagosimpuestos As DataTable = dttpagosimpuestos.FiltraParametros(String.Format("FolioFiscal = '{0}'", VentaFolioFiscal.ToLower)) + If dtTempdttpagosimpuestos IsNot Nothing AndAlso doc.ObjetoImpuesto = "02" AndAlso dtTempdttpagosimpuestos.Rows.Count = 0 Then + doc.ObjetoImpuesto = "01" + End If + + For Each drp As DataRow In dtTempdttpagosimpuestos.Rows doc.Impuestos.Add(New CFDIConceptosImpuestos With { .TrasladooRetencion = drp("Tipo").ToString, .Base = drp("Base").ToString.ToDecimal.RoundSQL, diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 1169b2c0c..ca9756752 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -25,6 +25,7 @@ Imports iText.Html2pdf Imports iText.Html2pdf.Resolver.Font Imports iText.Layout.Properties Imports Newtonsoft.Json +Imports Stimulsoft.Base.Json.Linq Namespace Extensiones #Region "E X T E N S I O N E S" @@ -153,6 +154,8 @@ Namespace Extensiones Public Const MinFecha As Date = #1/1/1900# Public Const MaxFecha As Date = #1/1/9999# Public Const GlobalRowVersion As Integer = 555555 + Public Const WhatsAppToken As String = "EAAQvTBdnkp4BO51Hmf5PD48NaY3ZC830gUS7WVNNoZAampZCK256UQ68OZCVCcPZCZCMmtW4xZA0PtP8HLRz6ZASufOgqk4A0lOpCi4ZBtWR5ZCpiMZCr9e0PpwUx4lZBW0spGZBM1DcOHQE5DnTmeJ1RISBnzI1i8RbRClLk2xbvNTu4elEXoSaofd96bW2mQ66ddLprSAZDZD" + #Region "PropiedadesEncriptación" Private _Key() As Byte = {} @@ -631,10 +634,9 @@ Namespace Extensiones Public Function EnviarNotificacionWhatsApp(NumeroTelefono As String, Mensaje As String, Optional NombrePlantilla As String = "") As Boolean Dim RetornoObj As String = "{}" Dim Retorno As Boolean = False - Dim Str As String = My.Computer.FileSystem.ReadAllText($"c:\temp\WSToken.txt") Try - Dim TokenAutorizacion As String = $"Bearer {Str}" + Dim TokenAutorizacion As String = $"Bearer {WhatsAppToken}" Using httpClient = New HttpClient() Using request = New HttpRequestMessage(HttpMethod.Post, New Uri("https://graph.facebook.com/v20.0/425866980604901/messages")) @@ -681,6 +683,78 @@ Namespace Extensiones Return Retorno End Function + Public Function EnviarNotificacionBienvendiaWhatsApp(NumeroTelefono As String, NombreUsuario As String, Mensaje As String) As Boolean + Dim RetornoObj As String = "{}" + Dim Retorno As Boolean = False + + Try + Dim TokenAutorizacion As String = $"Bearer {WhatsAppToken}" + Using httpClient = New HttpClient() + Using request = New HttpRequestMessage(HttpMethod.Post, New Uri("https://graph.facebook.com/v20.0/425866980604901/messages")) + + request.Headers.Add("Authorization", TokenAutorizacion) + Dim json = New Newtonsoft.Json.Linq.JObject() + json.Add(New Newtonsoft.Json.Linq.JProperty("messaging_product", "whatsapp")) + json.Add(New Newtonsoft.Json.Linq.JProperty("to", NumeroTelefono)) + + json.Add(New Newtonsoft.Json.Linq.JProperty("type", "template")) + + Dim plantilla As New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("name", "bienvenida"), + New Newtonsoft.Json.Linq.JProperty("language", + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("code", "es_MX") + ) + ), + New Newtonsoft.Json.Linq.JProperty("components", + New Newtonsoft.Json.Linq.JArray( + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "header"), + New Newtonsoft.Json.Linq.JProperty("parameters", + New Newtonsoft.Json.Linq.JArray( + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "text"), + New Newtonsoft.Json.Linq.JProperty("text", NombreUsuario) + ) + ) + ) + ), + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "body"), + New Newtonsoft.Json.Linq.JProperty("parameters", + New Newtonsoft.Json.Linq.JArray( + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "text"), + New Newtonsoft.Json.Linq.JProperty("text", Mensaje) + ) + ) + ) + ) + ) + ) + ) + + json.Add(New Newtonsoft.Json.Linq.JProperty("template", plantilla)) + + Using content = New StringContent(json.ToString, Encoding.UTF8, "application/json") + request.Content = content + Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result + + If response.StatusCode = Net.HttpStatusCode.OK Then + RetornoObj = response.Content.ReadAsStringAsync().Result + Retorno = True + End If + End Using + + End Using + + End Using + Catch ex As Exception + RetornoObj = New Newtonsoft.Json.Linq.JObject(New Newtonsoft.Json.Linq.JProperty("Error", ex.ToString())).ToString() + GuardaLog("Ocurrió un error al enviar la informacion por whatsapp" & ex.Message) + End Try + Return Retorno + End Function #End Region diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 8a0b376d3..618b6ce5f 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -1513,7 +1513,7 @@ Partial Class Compras_Proveedores GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing - Alert("El Proveedor se guardó correctamente. " & "
" & MsgCuentaContable, TipoMensaje.MsgInformacion, If(Request("CveFactura") Is Nothing, "document.location.href=""/Compras/CatProveedores.aspx""", "window.opener.location.href = window.opener.location.href; window.close();")) + Alert("El Proveedor se guardó correctamente. " & "
" & MsgCuentaContable, TipoMensaje.MsgInformacion, If(Request("CveFactura") Is Nothing, "document.location.href=""/Compras/CatProveedores.aspx""", "if (window.opener && !window.opener.closed) { window.opener.location.href = window.opener.location.href; window.close(); }else{ alert('No se pudo recargar la pestaña origen, recargue manualmente si lo necesita.'); }")) RecargaGlobalCuentasBancarias() End If End If diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx index fc05ef3e2..c95928cab 100644 --- a/Compras/eFacturas.aspx +++ b/Compras/eFacturas.aspx @@ -435,7 +435,7 @@ - + diff --git a/OI/Proyecto.aspx b/OI/Proyecto.aspx index a0ce32782..59132a3d1 100644 --- a/OI/Proyecto.aspx +++ b/OI/Proyecto.aspx @@ -437,6 +437,7 @@ } gantt.render(); } + var datosGant = []; function loadGant() { gantt.config.date_format = "%Y-%m-%d %H:%i"; diff --git a/Sistemas/SessionesActivas.aspx b/Sistemas/SessionesActivas.aspx index 312a880fb..580cd16d9 100644 --- a/Sistemas/SessionesActivas.aspx +++ b/Sistemas/SessionesActivas.aspx @@ -129,7 +129,6 @@ - diff --git a/Sistemas/SessionesActivas.aspx.vb b/Sistemas/SessionesActivas.aspx.vb index 8e1823580..36c3c06e8 100644 --- a/Sistemas/SessionesActivas.aspx.vb +++ b/Sistemas/SessionesActivas.aspx.vb @@ -192,6 +192,10 @@ Partial Class SessionesActivas Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs) Dim mensaje = TxtMensaje.Text.Trim() + "
Liga" + + + EnviarNotificacionWhatsApp("6621143532", mensaje) + ClsSisNotificaciones.EnviarAlerta("Aviso", mensaje, RCveUsuario, Tipo:=TipoNotificacion.ToastInformacionB) RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')") diff --git a/Sistemas/UsuarioDetalle.aspx b/Sistemas/UsuarioDetalle.aspx index 06a85cab7..afe241115 100644 --- a/Sistemas/UsuarioDetalle.aspx +++ b/Sistemas/UsuarioDetalle.aspx @@ -1249,7 +1249,7 @@
-
+
@@ -2622,6 +2622,37 @@
+
+
+
+
+ + Notificaciones +
+
+
+
+
+
+ + +
+
+
+ + + + + + + + +
Celular: + +
+
+
+
@@ -3194,7 +3225,6 @@
-
diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index ab86e0424..7c54aa4ee 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -2,6 +2,7 @@ Option Strict On Imports System.Data +Imports System.Net.Http Imports Extensiones Imports Microsoft.Reporting.WebForms @@ -470,6 +471,10 @@ Partial Class Sistemas_UsuarioDetalle TrCodigoAcceso.Visible = True End If + If UsuarioActual.CveRol = 1 Then + DivNotificaciones.Visible = True + End If + CargaDatos() InicializaClonarUsuario() InicializaRestricciones() @@ -611,6 +616,7 @@ Partial Class Sistemas_UsuarioDetalle TxtPorcentajeMaximoAutorizacion.Text = ObjUsuario.DtResultados.Rows(0)("PorcentajeMaximoAutorizacion").ToString().ToDecimal().FormatoNumero(2) TxtDiasVencidos.Text = ObjUsuario.DtResultados.Rows(0)("DiasMaximoAutorizacion").ToString() + TxtTelefono.Text = ObjUsuario.DtResultados.Rows(0)("Celular").ToString() Else Alert("El Usuario Solicitado no existe, Revise su búsqueda.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False @@ -858,7 +864,7 @@ Partial Class Sistemas_UsuarioDetalle 'REGISTRA O ACTUALIZA LOS DATOS GENERALES DEL USUARIO If CveUsuario = -1 Then - CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal(), PorcentajeMaximoAutorizacion:=TxtPorcentajeMaximoAutorizacion.Text.ToDecimal(), DiasMaximoAutorizacion:=TxtDiasVencidos.Text.ToEntero()) + CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal(), PorcentajeMaximoAutorizacion:=TxtPorcentajeMaximoAutorizacion.Text.ToDecimal(), DiasMaximoAutorizacion:=TxtDiasVencidos.Text.ToEntero(), Celular:=TxtTelefono.Text.Trim()) EsNuevoUsuario = True If CveUsuario = -1 Then TieneError = True @@ -870,7 +876,7 @@ Partial Class Sistemas_UsuarioDetalle End If Next Else - If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal(), PorcentajeMaximoAutorizacion:=TxtPorcentajeMaximoAutorizacion.Text.ToDecimal(), DiasMaximoAutorizacion:=TxtDiasVencidos.Text.ToEntero()) Then + If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal(), PorcentajeMaximoAutorizacion:=TxtPorcentajeMaximoAutorizacion.Text.ToDecimal(), DiasMaximoAutorizacion:=TxtDiasVencidos.Text.ToEntero(), Celular:=TxtTelefono.Text.Trim()) Then TieneError = True End If @@ -5013,4 +5019,82 @@ Partial Class Sistemas_UsuarioDetalle params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) ImprimirPDF("Empresas/Grales/Formatos/BitacoraLogin.rdlc", DtDatos, params, String.Format("BitacoraRegistro-{0}", NowADS().ToDateTime.ToShortDateString)) End Sub + + Protected Sub BtnEnviarMensaje_Click(sender As Object, e As EventArgs) + EnviarNotificacionBienvendiaWhatsApp($"52{TxtTelefono.Text}", TxtNombre.Text, "\nFavor de responder el mensaje") + Alert("El mensaje se envio correctamente") + End Sub + + 'Public Function EnviarNotificacionBienvendiaWhatsApp(NumeroTelefono As String, NombreUsuario As String, Mensaje As String) As Boolean + ' Dim RetornoObj As String = "{}" + ' Dim Retorno As Boolean = False + + ' Try + ' Dim TokenAutorizacion As String = $"Bearer {WhatsAppToken}" + ' Using httpClient = New HttpClient() + ' Using request = New HttpRequestMessage(HttpMethod.Post, New Uri("https://graph.facebook.com/v20.0/425866980604901/messages")) + + ' request.Headers.Add("Authorization", TokenAutorizacion) + ' Dim json = New Newtonsoft.Json.Linq.JObject() + ' json.Add(New Newtonsoft.Json.Linq.JProperty("messaging_product", "whatsapp")) + ' json.Add(New Newtonsoft.Json.Linq.JProperty("to", NumeroTelefono)) + + ' json.Add(New Newtonsoft.Json.Linq.JProperty("type", "template")) + + ' Dim plantilla As New Newtonsoft.Json.Linq.JObject( + ' New Newtonsoft.Json.Linq.JProperty("name", "bienvenida"), + ' New Newtonsoft.Json.Linq.JProperty("language", + ' New Newtonsoft.Json.Linq.JObject( + ' New Newtonsoft.Json.Linq.JProperty("code", "es_MX") + ' ) + ' ), + ' New Newtonsoft.Json.Linq.JProperty("components", + ' New Newtonsoft.Json.Linq.JArray( + ' New Newtonsoft.Json.Linq.JObject( + ' New Newtonsoft.Json.Linq.JProperty("type", "header"), + ' New Newtonsoft.Json.Linq.JProperty("parameters", + ' New Newtonsoft.Json.Linq.JArray( + ' New Newtonsoft.Json.Linq.JObject( + ' New Newtonsoft.Json.Linq.JProperty("type", "text"), + ' New Newtonsoft.Json.Linq.JProperty("text", NombreUsuario) + ' ) + ' ) + ' ) + ' ), + ' New Newtonsoft.Json.Linq.JObject( + ' New Newtonsoft.Json.Linq.JProperty("type", "body"), + ' New Newtonsoft.Json.Linq.JProperty("parameters", + ' New Newtonsoft.Json.Linq.JArray( + ' New Newtonsoft.Json.Linq.JObject( + ' New Newtonsoft.Json.Linq.JProperty("type", "text"), + ' New Newtonsoft.Json.Linq.JProperty("text", Mensaje) + ' ) + ' ) + ' ) + ' ) + ' ) + ' ) + ' ) + + ' json.Add(New Newtonsoft.Json.Linq.JProperty("template", plantilla)) + + ' Using content = New StringContent(json.ToString, Encoding.UTF8, "application/json") + ' request.Content = content + ' Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result + + ' If response.StatusCode = Net.HttpStatusCode.OK Then + ' RetornoObj = response.Content.ReadAsStringAsync().Result + ' Retorno = True + ' End If + ' End Using + + ' End Using + + ' End Using + ' Catch ex As Exception + ' RetornoObj = New Newtonsoft.Json.Linq.JObject(New Newtonsoft.Json.Linq.JProperty("Error", ex.ToString())).ToString() + ' GuardaLog("Ocurrió un error al enviar la informacion por whatsapp" & ex.Message) + ' End Try + ' Return Retorno + 'End Function End Class diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index c9591f344..0c09024d6 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -23,7 +23,75 @@ width: 100%; height: 600px; } + + + .fc-month-view .fc-day { + border-left: 4px solid #464646; + border-right: 4px solid #464646 + } + .fc-month-view .fc-week { + border-left: 4px solid #464646; + border-right: 4px solid #464646; + border-top: 4px solid #464646; + } + .fc-month-view .fc-row.fc-week.fc-widget-content:last-of-type { + border-bottom: 4px solid #464646!important; + } + + + + + + + + + + + @@ -287,6 +355,61 @@ <%--Calendario Tab--%> + + + + +
+
+ + Formato:   + + + + + + +
+ +     |     + Mostrar:   + + +
+
+
+ +
+ +
+
+
@@ -560,6 +683,7 @@ + diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index fb8d508e1..6832a1032 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -39,9 +39,17 @@ Partial Class RepContratosCalendario End Property #End Region - + Public Property RCveEvento As Integer + Get + Return If(ViewState("RCveEvento") IsNot Nothing, ViewState("RCveEvento").ToString().ToEntero(), 0) + End Get + Set(value As Integer) + ViewState("RCveEvento") = value + End Set + End Property Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + RCveEvento = 0 txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString() txtFechaF.Text = GetLastDayOfMonth(NowADS()).ToShortDateString() InicializaCombos() @@ -83,16 +91,16 @@ Partial Class RepContratosCalendario Private Sub CargaCronograma(Optional TipoVista As Integer = -1) If DtAvance IsNot Nothing Then + Dim separator As String = "" + Dim str As New StringBuilder() + str.AppendLine("datosGant=[") + + Dim StrFiltro As String = "" If DdlTipoUnidad.SelectedValue.ToEntero > 0 Then StrFiltro = " AND CveTipoActivoFijo = " & DdlTipoUnidad.SelectedValue Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3) " & StrFiltro, Orderby:=" TipoActivoFijo ASC, CodigoNumeroOrden ASC", DistinctColumns:={"Codigo", "CveActivoFijo"}) - 'For Each Row As DataRow In DtAvance.Rows - ' If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then - ' Row("CodigoAF") = "Unidad no asignada" - ' End If - 'Next Dim jsonData As New JArray() Dim jsonCategorias As New JArray() @@ -117,6 +125,16 @@ Partial Class RepContratosCalendario ) jsonData.Add(obj) strAF.AppendFormat("{0},", Row("CveAF")) + + 'uniad contrato y duracion + + Dim unidad As String = $"{Row("CodigoAF")}-{Row("NombreAF")}" + Dim duracion As String = $"{Row("FechaInicial").ToString.ToDate.ToString("dd/MM/yyyy HH:mm")} - {Row("FechaFinal").ToString.ToDate.ToString("dd/MM/yyyy HH:mm")}" + + str.AppendLine(String.Format("{0}{{id: {1}, text: ""{2}"", start_date: ""{3:yyyy/MM/dd HH:mm}"", end_date: ""{4:yyyy/MM/dd HH:mm}"", parent: {5}, progress:{6}, open: true, unidad: ""{7}"",duracion: ""{8}""}}", + separator, Row("CveContrato"), Row("NumeroContrato").ToString().Replace("\\", "\\\\").Replace("""", "\"""), Row("FechaInicial"), Row("FechaFinal"), 0, 100, unidad, duracion)) + separator = "," + Next If TipoVista = 1 Then 'solo con viajes @@ -134,11 +152,45 @@ Partial Class RepContratosCalendario Dim FechaF = txtFechaF.Text.ToDateTime() Dim ScriptZoom = $"zoomAxis({FechaI.Year},{FechaI.Month - 1},{FechaI.Day},{FechaF.Year},{FechaF.Month - 1},{FechaF.Day});" - RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});{ScriptZoom}", "A1") + + + str.AppendLine("];loadGant();") + RegistraScript(str.ToString()) + UPPGantt.Update() + UPGat.Update() End If End Sub + + 'Public Sub loadEvento() + ' Dim separator As String = "" + ' Dim str As New StringBuilder() + ' str.AppendLine("datosGant=[") + + ' Using oieve As New ClsOIEventos() + ' If oieve.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) AndAlso oieve.DtResultados.Rows.Count > 0 Then + ' Dim drow As System.Data.DataRow = oieve.DtResultados.Rows(0) + ' LblAsunto.Text = drow("Asunto").ToString() + ' End If + + ' If oieve.GetTareaConHijos(RCveEvento, UsuarioActual.CveEmpresa) Then + ' For Each dr As System.Data.DataRow In oieve.DtResultados.Select("Nivel > 0") + ' str.AppendLine(String.Format("{0}{{id: {1}, text: ""{2}"", start_date: ""{3:yyyy/MM/dd}"", end_date: ""{4:yyyy/MM/dd}"", parent: {5}, progress:{6}, open: true }}", + ' separator, dr("CveEvento"), dr("Asunto").ToString().Replace("\\", "\\\\").Replace("""", "\"""), dr("FechaInicio"), dr("FechaFin"), If(dr("Nivel").ToString().ToEntero() <= 1, 0, dr("CveEventoPadre").ToString().ToEntero()), dr("Avance").ToString().ToDecimal() / 100)) + ' separator = "," + ' Next + ' End If + ' End Using + + ' str.AppendLine("];loadGant();") + ' RegistraScript(str.ToString()) + ' UpContenido.Update() + ' ' { id: 2, text: "Direccion: evaluación de mercado", start_date: "2020/04/29 00:00", end_date: "2020/05/02 00:00",/*duration: 3,*/ parent: 1, progress: 0.25 } + 'End Sub + + + Private Sub InicializaCalendar() RegistraScript("InitCalendar();") diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index b3f400918..5b8f32de4 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -292,7 +292,7 @@
- + Imprimir Pedidos +
  • + Excel Pedidos +
  • +
    diff --git a/Ventas/RepPedidosSTF.aspx.vb b/Ventas/RepPedidosSTF.aspx.vb index e0c22e6ab..f687e60a2 100644 --- a/Ventas/RepPedidosSTF.aspx.vb +++ b/Ventas/RepPedidosSTF.aspx.vb @@ -65,6 +65,12 @@ Partial Class Ventas_RepPedidosSTF End Sub Protected Sub CargaDatos() + LnkImprimirPedidos.Visible = False + LnkImprimirPedidosExcel.Visible = False + + + + DatosGV = New DataTable Dim Opcion As Integer = 1 Dim FechaInicio As Date = MinFecha @@ -99,6 +105,7 @@ Partial Class Ventas_RepPedidosSTF GvDatos.DataSource = DatosGV If DatosGV IsNot Nothing AndAlso DatosGV.Rows.Count > 0 Then LnkImprimirPedidos.Visible = True + LnkImprimirPedidosExcel.Visible = True End If End If ObjVentas.Dispose() @@ -372,7 +379,15 @@ Partial Class Ventas_RepPedidosSTF End Sub Protected Sub LnkImprimirPedidos_Click(sender As Object, e As EventArgs) + ImprimirReporte("PDF") + End Sub + Protected Sub LnkImprimirPedidosExcel_Click(sender As Object, e As EventArgs) + ImprimirReporte("Excel") + End Sub + + + Private Sub ImprimirReporte(Formato As String) Dim FechaI As String = txtFechaI.Text Dim FechaF As String = txtFechaF.Text If txtFechaI.Text = "" Then FechaI = "-1" @@ -408,13 +423,13 @@ Partial Class Ventas_RepPedidosSTF - ImprimirPDF("Empresas/Grales/Formatos/RepPedidos.rdlc", DatosGV, params, "ReportePedidos") + ImprimirPDF("Empresas/Grales/Formatos/RepPedidos.rdlc", DatosGV, params, "ReportePedidos", Formato) Else Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) End If - End Sub + Protected Sub BtnEditarHorariosPedidos_Click(sender As Object, e As EventArgs) Dim objSisEmpresas As New ClsSisEmpresas If objSisEmpresas.UpdateEmpresaFuncionalidad(546, $"{TxtHorarioDe.Text}|{TxtHorarioA.Text}", UsuarioActual.CveEmpresa) Then