This commit is contained in:
rakcsle
2022-05-20 10:14:10 -07:00
parent 1dd3fd0343
commit 71f75462f8
7 changed files with 150 additions and 1647 deletions

View File

@@ -2642,14 +2642,41 @@ Partial Class PopUpVerFactura
Dim Guardar As Boolean = If(GuardarPDF, True, If(AplicaPagare = "1", False, True))
If Not IsNothing(Vta) Then
'04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME
If UsuarioActual.Empresa.CvePlataforma = 2 Then
GeneraPDFVtaPyMe(Vta, "PDF")
Dim PathArchivo As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
Dim Archivo As New System.IO.FileInfo(PathArchivo)
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(PathArchivo)
'HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
Archivo = Nothing
Else
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar), Vta.SerieFolio, "PDF")
Vta = Nothing
'04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME
If UsuarioActual.Empresa.CvePlataforma = 2 Then
GeneraPDFVtaPyMe(Vta, "PDF")
Else
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar), Vta.SerieFolio, "PDF")
Vta = Nothing
End If
End If
End If
End Sub