envío de correo
This commit is contained in:
@@ -7063,14 +7063,14 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'funcionalidad EnviarSMSTimbrado
|
||||
If CveVenta <= 0 And UsuarioActual.Empresa.Funcionalidad(152) <> "" And DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
If ObjCliente.CobranzaTelefono <> "" Then
|
||||
LblMensaje.Text = $"Se enviará mensaje SMS a {ObjCliente.CobranzaTelefono}"
|
||||
Else
|
||||
LblMensaje.Text = $"El Cliente no tiene teléfono para envío SMS "
|
||||
End If
|
||||
LblMensaje.Visible = True
|
||||
End If
|
||||
'If CveVenta <= 0 And UsuarioActual.Empresa.Funcionalidad(152) <> "" And DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
' If ObjCliente.CobranzaTelefono <> "" Then
|
||||
' LblMensaje.Text = $"Se enviará mensaje SMS a {ObjCliente.CobranzaTelefono}"
|
||||
' Else
|
||||
' LblMensaje.Text = $"El Cliente no tiene teléfono para envío SMS "
|
||||
' End If
|
||||
' LblMensaje.Visible = True
|
||||
'End If
|
||||
|
||||
'If Not ObjCliente.RFC = "XAXX010101000" Then
|
||||
' TxtNumCtaPago.Text = ObjCliente.NumCtaPago
|
||||
@@ -11139,9 +11139,9 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
If SeTimbro AndAlso ObjFactura.TipoDocto.Contiene("Ing") Then
|
||||
EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
||||
End If
|
||||
'If SeTimbro AndAlso ObjFactura.TipoDocto.Contiene("Ing") Then
|
||||
' EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
||||
' End If
|
||||
|
||||
'If Not SeTimbro Then
|
||||
' Alert(MsgErrorTimbrado, TipoMensaje.MsgError)
|
||||
@@ -11363,7 +11363,7 @@ Partial Class Ventas
|
||||
'ENVIAR NOTIFICACION DE SMS
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ped") Then
|
||||
Dim CorreoDestino As String = "rene.molina@adssistemas.mx"
|
||||
Dim CorreoDestinoAlmacen As String = "almacen@smsmedicalsolutions.com"
|
||||
|
||||
If RBLTipoVenta.SelectedValue.Contiene("1", "2") Then
|
||||
Dim ListMateriales As New List(Of GenericaCantidadProducto)
|
||||
@@ -11376,7 +11376,8 @@ Partial Class Ventas
|
||||
EnviaNotificacionSMS(4, UsuarioActual.Empresa, CveVenta, TxtFolio.Text, TxtFechaOS.Text.ToDateTime, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedItem.Text, LblCliente.Text), DdlMedico.SelectedItem.Text, DdlProcedimiento.SelectedItem.Text, "", DdlVendedor.SelectedItem.Text, "", Nothing, CorreoDestino)
|
||||
End If
|
||||
'cirugía en el mismo día o si es despues de las 9 y requiere técnico, 'jefe de técnicos
|
||||
If TxtFechaOS.Text.ToDate.ToShortDateString = NowADS.ToShortDateString OrElse (NowADS.Hour > 21 OrElse ChkRequiereTecnicoModal.Checked) Then
|
||||
If TxtFechaOS.Text.ToDate.ToShortDateString = NowADS.ToShortDateString OrElse (NowADS.Hour > 21 And NowADS.AddDays(1).ToShortDateString = TxtFechaOS.Text.ToDate.ToShortDateString AndAlso ChkRequiereTecnicoModal.Checked) Then
|
||||
CorreoDestinoAlmacen = "esandoval@smsmedicalsolutions.com "
|
||||
EnviaNotificacionSMS(5, UsuarioActual.Empresa, CveVenta, TxtFolio.Text, TxtFechaOS.Text.ToDateTime, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedItem.Text, LblCliente.Text), DdlMedico.SelectedItem.Text, DdlProcedimiento.SelectedItem.Text, "", DdlVendedor.SelectedItem.Text, "", Nothing, CorreoDestino)
|
||||
End If
|
||||
End If
|
||||
@@ -17940,20 +17941,20 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'NOTIFICACION DE SMS
|
||||
Dim EstatusSMS As Integer = 0
|
||||
If ObjFactura.TipoDocto = "Ing" Then
|
||||
Dim ObjEventos As New ClsOIEventos
|
||||
EnviarSMSTimbrado(ObjEventos)
|
||||
ObjEventos.Dispose()
|
||||
End If
|
||||
Select Case EstatusSMS
|
||||
Case 1
|
||||
MensajeAlert.AppendFormat("<b>Notificación SMS:</b> enviado con éxito al cliente al celular: <b>{0}</b>", ObjFactura.Cliente.CobranzaTelefono)
|
||||
Case 2
|
||||
MensajeAlert.AppendFormat("<b>Notificación SMS:</b> sin enviar. Ocurrió un error en el envío, por favor verifique la información del cliente.")
|
||||
Case 3
|
||||
MensajeAlert.AppendFormat("<b>Notificación SMS:</b> sin enviar. No se pudo cargar el celular del cliente, por favor verifique la información del cliente.")
|
||||
End Select
|
||||
'Dim EstatusSMS As Integer = 0
|
||||
'If ObjFactura.TipoDocto = "Ing" Then
|
||||
' Dim ObjEventos As New ClsOIEventos
|
||||
' EnviarSMSTimbrado(ObjEventos)
|
||||
' ObjEventos.Dispose()
|
||||
'End If
|
||||
'Select Case EstatusSMS
|
||||
' Case 1
|
||||
' MensajeAlert.AppendFormat("<b>Notificación SMS:</b> enviado con éxito al cliente al celular: <b>{0}</b>", ObjFactura.Cliente.CobranzaTelefono)
|
||||
' Case 2
|
||||
' MensajeAlert.AppendFormat("<b>Notificación SMS:</b> sin enviar. Ocurrió un error en el envío, por favor verifique la información del cliente.")
|
||||
' Case 3
|
||||
' MensajeAlert.AppendFormat("<b>Notificación SMS:</b> sin enviar. No se pudo cargar el celular del cliente, por favor verifique la información del cliente.")
|
||||
'End Select
|
||||
|
||||
'MUESTA Alert OK
|
||||
'MensajeAlert.Append("El Documento se generó correctamente")
|
||||
@@ -27920,49 +27921,49 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region " ENVIAR SMS - CONFIRMACION DE TIMBRADO "
|
||||
Private Function EnviarSMSTimbrado(ByRef ObjEventos As ClsOIEventos) As Integer
|
||||
'NOTA:
|
||||
'0 = NO APLICA
|
||||
'1 = TODO FINO
|
||||
'2 = ERROR
|
||||
'3 = SIN CELULAR - PROBLEMA CON EL CELULAR
|
||||
Try
|
||||
Dim Mensaje As String = UsuarioActual.Empresa.Funcionalidad(152)
|
||||
If Mensaje = "" Then Return 0
|
||||
'Private Function EnviarSMSTimbrado(ByRef ObjEventos As ClsOIEventos) As Integer
|
||||
' 'NOTA:
|
||||
' '0 = NO APLICA
|
||||
' '1 = TODO FINO
|
||||
' '2 = ERROR
|
||||
' '3 = SIN CELULAR - PROBLEMA CON EL CELULAR
|
||||
' Try
|
||||
' Dim Mensaje As String = UsuarioActual.Empresa.Funcionalidad(152)
|
||||
' If Mensaje = "" Then Return 0
|
||||
|
||||
Dim Celular As String = ""
|
||||
' Dim Celular As String = ""
|
||||
|
||||
Try
|
||||
Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
Catch ex As Exception
|
||||
' Try
|
||||
' Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
' Catch ex As Exception
|
||||
|
||||
End Try
|
||||
' End Try
|
||||
|
||||
If Celular.Length <> 10 Then Return 3
|
||||
' If Celular.Length <> 10 Then Return 3
|
||||
|
||||
'ARMA MENSAJE
|
||||
'4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
||||
Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
||||
Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
||||
Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
||||
If Mensaje = "" Then Return 2
|
||||
' 'ARMA MENSAJE
|
||||
' '4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
||||
' Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
||||
' Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
' Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
||||
' Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
' Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
||||
' If Mensaje = "" Then Return 2
|
||||
|
||||
Dim ObjMensaje As New ClsTecnoMovil
|
||||
If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
||||
If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
||||
End If
|
||||
Return 1
|
||||
Else
|
||||
Return 2
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el SMS", ex)
|
||||
Return 0
|
||||
End Try
|
||||
' Dim ObjMensaje As New ClsTecnoMovil
|
||||
' If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
||||
' If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
||||
' End If
|
||||
' Return 1
|
||||
' Else
|
||||
' Return 2
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al generar el SMS", ex)
|
||||
' Return 0
|
||||
' End Try
|
||||
|
||||
End Function
|
||||
'End Function
|
||||
#End Region
|
||||
|
||||
#Region " COMPLEMENTOS PAGO "
|
||||
|
||||
Reference in New Issue
Block a user