Error al enviar correo de factura al obtener el serie folio

This commit is contained in:
2020-10-12 19:32:03 -07:00
parent e30c356fc1
commit 30eebdb2da

View File

@@ -12625,7 +12625,7 @@ Partial Class Ventas
Try Try
' BytesPdfCotizacion(CveVenta) ' BytesPdfCotizacion(CveVenta)
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF)) Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
Hilo.Start() Hilo.Start()
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió error al mandar Mail", ex) OnError("Ocurrió error al mandar Mail", ex)
@@ -12667,7 +12667,7 @@ Partial Class Ventas
Try Try
' BytesPdfCotizacion(CveVenta) ' BytesPdfCotizacion(CveVenta)
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF)) Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
Hilo.Start() Hilo.Start()
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió error al mandar Mail", ex) OnError("Ocurrió error al mandar Mail", ex)
@@ -12706,7 +12706,7 @@ Partial Class Ventas
Try Try
' BytesPdfCotizacion(CveVenta) ' BytesPdfCotizacion(CveVenta)
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF)) Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
Hilo.Start() Hilo.Start()
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió error al mandar Mail", ex) OnError("Ocurrió error al mandar Mail", ex)
@@ -17757,7 +17757,7 @@ Partial Class Ventas
#End Region #End Region
#Region " MANDA CORREO " #Region " MANDA CORREO "
Private Sub MandaMails(CveVenta As Integer, EnviarFactura As Boolean, XML As String, PDF As String) Private Sub MandaMails(CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String)
Dim ObjMail As New ClsSisMail() Dim ObjMail As New ClsSisMail()
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
@@ -17770,12 +17770,12 @@ Partial Class Ventas
Dim TipoComprobante = "" Dim TipoComprobante = ""
If DdlTipoComprobante.SelectedValue.ToString() = "Ing" Then TipoComprobante = "Factura" If TipoDocto = "Ing" Then TipoComprobante = "Factura"
If DdlTipoComprobante.SelectedValue.ToString() = "Egs" Then TipoComprobante = "Nota de Crédito" If TipoDocto = "Egs" Then TipoComprobante = "Nota de Crédito"
If DdlTipoComprobante.SelectedValue.ToString() = "Dev" Then TipoComprobante = "Nota de Devolución" If TipoDocto = "Dev" Then TipoComprobante = "Nota de Devolución"
If DdlTipoComprobante.SelectedValue.ToString() = "Rem" Then TipoComprobante = "Remisión" If TipoDocto = "Rem" Then TipoComprobante = "Remisión"
If DdlTipoComprobante.SelectedValue.ToString() = "Cot" Then TipoComprobante = "Cotización" If TipoDocto = "Cot" Then TipoComprobante = "Cotización"
If DdlTipoComprobante.SelectedValue.ToString() = "Ant" Then TipoComprobante = "Anticipo" If TipoDocto = "Ant" Then TipoComprobante = "Anticipo"
If UsuarioActual.Empresa.PlantillaMailVenta.Trim.Length > 0 Then If UsuarioActual.Empresa.PlantillaMailVenta.Trim.Length > 0 Then
Cuerpo = UsuarioActual.Empresa.PlantillaMailVenta Cuerpo = UsuarioActual.Empresa.PlantillaMailVenta
@@ -17785,14 +17785,14 @@ Partial Class Ventas
Cuerpo = Cuerpo.Replace("{""Fecha""}", TxtFecha.Text) Cuerpo = Cuerpo.Replace("{""Fecha""}", TxtFecha.Text)
Cuerpo = Cuerpo.Replace("{""Total""}", TxtTotal.Text) Cuerpo = Cuerpo.Replace("{""Total""}", TxtTotal.Text)
Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", TxtFechaPago.Text) Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", TxtFechaPago.Text)
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", ObjFactura.SerieFolio) Cuerpo = Cuerpo.Replace("{""SerieFolio""}", SerieFolio)
End If End If
If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then
Asunto = UsuarioActual.Empresa.AsuntoPlantillaMailVenta Asunto = UsuarioActual.Empresa.AsuntoPlantillaMailVenta
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante) Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Asunto = Asunto.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text) Asunto = Asunto.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text)
Asunto = Asunto.Replace("{""SerieFolio""}", ObjFactura.SerieFolio) Asunto = Asunto.Replace("{""SerieFolio""}", SerieFolio)
End If End If
If Not EnviarFactura Then If Not EnviarFactura Then