General
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user