This commit is contained in:
2024-05-27 20:14:32 -07:00
4 changed files with 60 additions and 44 deletions

View File

@@ -152,7 +152,10 @@ Public Class ClsSisNotificaciones
#Region "N O T I F I C A C I O N E S"
Public Shared Sub EnviarAlerta(Titulo As String, Mensaje As String, CveUsuario As String, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar, Optional TimeOut As Integer = 0)
Dim hub = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)()
'VERIFICA SI EXISTE LA CONEXION DEL USUARIO
If Notificaciones.UsuariosConexiones.Keys.Any(Function(key) key = CveUsuario) Then
hub.Clients.Client(Notificaciones.UsuariosConexiones(CveUsuario)).alertaVentana(Titulo, Mensaje, DirectCast(Tipo, Integer), TimeOut)
End If
End Sub

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SessionesActivas.aspx.vb" Inherits="SessionesActivas" %>
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SessionesActivas.aspx.vb" Inherits="SessionesActivas" EnableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>

View File

@@ -190,7 +190,9 @@ Partial Class SessionesActivas
RegistraScript("$(""#DivMensaje"").modal();")
End Sub
Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs)
ClsSisNotificaciones.EnviarAlerta("Aviso", TxtMensaje.Text.Trim(), RCveUsuario, Tipo:=TipoNotificacion.ToastInformacionB)
Dim mensaje = TxtMensaje.Text.Trim() + "<br/> <a target='_blank' href='https://www.w3schools.com'>Liga</a>"
ClsSisNotificaciones.EnviarAlerta("Aviso", mensaje, RCveUsuario, Tipo:=TipoNotificacion.ToastInformacionB)
RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')")
End Sub

View File

@@ -10052,6 +10052,8 @@ Partial Class Ventas
'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then
If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists Or ArchivoSti3.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
If Not UsuarioActual.TienePermisoProceso(380) Then
HplDownPDF.Visible = True
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
@@ -10069,6 +10071,7 @@ Partial Class Ventas
HplImprimirTicket.Visible = True
HplImprimirTicket.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta)))
End If
End If
End If
@@ -10895,10 +10898,12 @@ Partial Class Ventas
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
If SeTimbro Then
If Not UsuarioActual.TienePermisoProceso(380) Then
Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
If File.Exists(ArchivoXML) Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
End If
End If
'MANDA CORREO
Try
Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
@@ -10928,6 +10933,7 @@ Partial Class Ventas
'DESCARGA PDF
If Not UsuarioActual.TienePermisoProceso(380) Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Ped") Then
'If Not ImprimeAlert Then
@@ -10942,6 +10948,8 @@ Partial Class Ventas
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
End If
End If
End If
'CRM
If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
@@ -11018,6 +11026,7 @@ Partial Class Ventas
' End If
'End If
If Not UsuarioActual.TienePermisoProceso(380) Then
If DdlTipoComprobante.SelectedValue = "Cot" Then
If Not CveEmpresaCRM > 0 Then
@@ -11042,6 +11051,8 @@ Partial Class Ventas
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
End If
End If
End If
'ENVIA CORREO CON DETALLE DEL CONTRATO
If DdlTipoComprobante.SelectedValue.Contiene("DPe", "Ped") Then