This commit is contained in:
Antonio Gonzalez
2020-06-23 20:01:56 -07:00
2 changed files with 42 additions and 29 deletions

View File

@@ -4233,6 +4233,15 @@ Namespace Modelos
Return Retorno Return Retorno
End If End If
'VALIDACION DE PEDIDOS: SI ESTA ENTEGADO NO SE PUEDA CANCELAR
If UsuarioActual.CveEmpresa = 72 AndAlso ObjFactura.TipoDocto = "Ped" AndAlso TieneAlmacen AndAlso ObjFactura.SaldoAlmacen <> 0 Then
Retorno.Mensaje = "El pedido no se puede cancelar debido ha que ya fue entregado."
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
Return Retorno
End If
Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion) Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion)
Dim CancelacionFecha As Date Dim CancelacionFecha As Date

View File

@@ -3344,39 +3344,43 @@ Partial Class Bancos_PagoElectronicoGrupos
End Sub End Sub
Private Sub MandaCorreo(Para As String, Asunto As String, Body As String, CveIE As Integer, Comprobante As String, File As Byte()) Private Sub MandaCorreo(Para As String, Asunto As String, Body As String, CveIE As Integer, Comprobante As String, File As Byte())
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 Mail As New ClsSisMail() Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
Para = If(Para IsNot Nothing, Para, "") If Comprobante IsNot Nothing AndAlso Comprobante <> "" Then
Asunto = If(Asunto IsNot Nothing, Asunto, "") ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = Comprobante})
Body = If(Body IsNot Nothing, Body, "")
Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
If Comprobante IsNot Nothing AndAlso Comprobante <> "" Then
ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = Comprobante})
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 End If
Next
Para = Para.Substring(0, Para.Length - 1) 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
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}") Then
Dim objIE As New ClsBancos
objIE.UpdateBancos_IENotificaciones(1, "-1", "-1", CveIE)
objIE.Dispose()
End If
Catch ex As Exception
OnError("Ocurrio un error al enviar el correo", ex)
End Try
If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos, Displayname:=$"SIG Notificaciones: Pago de {UsuarioActual.Empresa.Empresa}") Then
Dim objIE As New ClsBancos
objIE.UpdateBancos_IENotificaciones(1, "-1", "-1", CveIE)
objIE.Dispose()
End If
End Sub End Sub