diff --git a/AF/AF.aspx b/AF/AF.aspx index 8ce476197..506805e0f 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -3058,7 +3058,7 @@ - + diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 7a39219a4..da147e2c4 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4446,5 +4446,312 @@ Public Class ClsBancos End Function +#Region "N O T I F I C A C I O N E S D E P A G O P R O V E E D O R E S" + + Public Function NotificacionPago(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActual As Usuario) As Boolean + + Dim RutaComprobante As String = "" + If GetBancosIE(CveIENotificar, UsuarioActual.CveEmpresa) Then + RutaComprobante = Comprobante + End If + + + Dim Body As String = GeneraCorreo(CveIENotificar, UsuarioActual) + 'Dim Comprobante As String = "" + + Dim File As Byte() = Nothing + + + 'If MostrarConfirmacion Then + Return MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, RutaComprobante, File, UsuarioActual, CopiaPara) + 'Else + ' Dim Hilo As New Threading.Thread(Sub() MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, RutaComprobante, File, UsuarioActual, MostrarConfirmacion, CopiaPara)) + ' Hilo.Start() + 'End If + + + End Function + + Private Function MandaCorreo(Para As String, Asunto As String, Body As String, RutaComprobante As String, File As Byte(), UsuarioActual As Usuario, CopiaPara As String) As Boolean + + Dim Respuesta As Boolean = False + + Try + Dim Mail As New ClsSisMail() + Para = If(Para IsNot Nothing, Para, "") + Asunto = If(Asunto IsNot Nothing, Asunto, "") + Body = If(Body IsNot Nothing, Body, "") + + Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail) + + If RutaComprobante IsNot Nothing AndAlso RutaComprobante <> "" Then + ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaComprobante}) + End If + + If File IsNot Nothing Then + ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoCuentaCxP.pdf"}) + End If + + Dim separador As Char() = {";"c, ","c} + Dim strArray As String() = Para.Split(separador) + + Para = "" + + For Each sCorreo As String In strArray + If ClsSisMail.IsMailShared(sCorreo) And sCorreo.Trim.Length > 0 Then + Para = $"{Para}{sCorreo};" + End If + Next + + + If Para.Length > 0 Then + + Para = Para.Substring(0, Para.Length - 1) + + If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos, Displayname:=$"SIG Notificaciones: Pago de {UsuarioActual.Empresa.Empresa}", CCP:=CopiaPara) Then + + Respuesta = True + 'If MostrarConfirmacion Then + ' Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) + 'End If + + + + 'If MostrarConfirmacion Then + ' Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError) + 'End If + + End If + + End If + + + Catch ex As Exception + OnError("Ocurrio un error al enviar el correo", ex) + + + End Try + + Return Respuesta + + End Function + + Private Function GeneraCorreo(CveIENotificar As Integer, UsuarioActual As Usuario) As String + + Dim strBody As New StringBuilder + + + If GetBancosIE(CveIENotificar, UsuarioActual.CveEmpresa) Then + strBody.Append(" ") + strBody.Append("
") + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + strBody.AppendFormat("| ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" | ") + strBody.AppendFormat("
| ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" | ") + strBody.AppendFormat("

");
+ strBody.Append($"
");
strBody.Append(""); strBody.Append($" Apreciable {ClienteNombre}, su pedido ya se encuentra en camino con el número de guía {Guia} y rastreo {Rastreo} de {Paqueteria}. Le confirmamos los productos que recibirá conforme a la {TipoDocto}:"); diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index 421f862af..2633ccd25 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -1102,9 +1102,12 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas StringBuilder strBody = new StringBuilder(); strBody.Append(""); + strBody.Append("
"); + strBody.Append(""); + strBody.Append(""); strBody.Append(" "); strBody.Append("
");
+ strBody.Append($"
");
strBody.Append(""); strBody.Append($" Apreciable {ClienteNombre}, su pedido correspondiente a la {tipoDocto}:"); diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index c8a2bc967..d2acbfd5f 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2653,7 +2653,7 @@ Partial Class Inventarios_EntregaAlmacen 'Paqueterias guias If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then Dim CveEstatus As Integer = 1 ' DdlEstatus.SelectedValue.ToEntero() - Dim Fecha As String = "-1" 'TxtFechaPaqInterna.Text + Dim Fecha As String = Now.ToString 'TxtFechaPaqInterna.Text Dim FechaEstimada As String = "-1" 'If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text) Dim NoCajas As Integer = 0 'TxtNoCajas.Text.ToEntero() Dim Observaciones As String = "" 'TxtObservacionesPaqInterna.Text @@ -2665,10 +2665,8 @@ Partial Class Inventarios_EntregaAlmacen If CvePaqueteriaGuia > 0 Then If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then - If ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimientoSalida, -1) Then + If Not ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimientoSalida, -1) Then ''manda correo - MandaCorreoEntrega(CveVentaSurtir) - Else ErrorMovInv = True End If End If @@ -3125,7 +3123,7 @@ Partial Class Inventarios_EntregaAlmacen 'Paqueterias Guias If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then Dim CveEstatus As Integer = 0 ' DdlEstatus.SelectedValue.ToEntero() - Dim Fecha As String = "-1" 'TxtFechaPaqInterna.Text + Dim Fecha As String = Now.ToString 'TxtFechaPaqInterna.Text Dim FechaEstimada As String = "-1" 'If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text) Dim NoCajas As Integer = 0 'TxtNoCajas.Text.ToEntero() Dim Observaciones As String = "" 'TxtObservacionesPaqInterna.Text @@ -3222,9 +3220,12 @@ Partial Class Inventarios_EntregaAlmacen Next strBody.Append("") + strBody.Append("
") + strBody.Append("") + strBody.Append("") strBody.Append(" ") strBody.Append("
")
+ strBody.Append($"
")
strBody.Append("") strBody.Append($" Apreciable {ClienteNombre}, le confirmamos los") diff --git a/Inventarios/EntregasPorRealizar.aspx.cs b/Inventarios/EntregasPorRealizar.aspx.cs index 46615ecb7..4a24c6f5a 100644 --- a/Inventarios/EntregasPorRealizar.aspx.cs +++ b/Inventarios/EntregasPorRealizar.aspx.cs @@ -148,9 +148,12 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas StringBuilder strBody = new StringBuilder(); strBody.Append(""); + strBody.Append("
"); + strBody.Append(""); + strBody.Append(""); strBody.Append(" "); strBody.Append("
");
+ strBody.Append($"
");
strBody.Append(""); strBody.Append($" Apreciable {ClienteNombre}, su pedido ya se encuentra en camino. Le confirmamos los productos que recibirá conforme a la "); diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx b/Inventarios/PaquetesArmadoDesarmado.aspx index b6b4271e3..403797160 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx +++ b/Inventarios/PaquetesArmadoDesarmado.aspx @@ -216,18 +216,38 @@