This commit is contained in:
Rakcsle Supertramp
2020-05-12 18:36:41 -07:00
11 changed files with 599 additions and 155 deletions

View File

@@ -186,9 +186,10 @@ Partial Class PopUpVerFactura
If Request("REPORTE") IsNot Nothing Then
CType(Session("DTPDF"), HtmlTable).ExportToPDF("Reporte")
End If
'OPCIONES
End If
'OPCIONES
If Request("P") IsNot Nothing AndAlso Decripta((Request("P").ToString)) <> "" Then
Dim UrlParametros As Hashtable = Parametros(Decripta((Request("P").ToString)))
If UrlParametros("OP") IsNot Nothing AndAlso UrlParametros("OP").ToString <> "" Then
@@ -235,10 +236,16 @@ Partial Class PopUpVerFactura
UsuarioToken.Empresa = ObjEmpresa.Empresa
End If
ObjEmpresa.Dispose()
End Sub
End Sub
#End Region
Private Sub SeleccionaReporte(UrlParametros As Hashtable)
'DESCARGA COMPROBANTE
If UrlParametros("OP").ToString = "IEComprobante" Then
DescargaComprobante(UrlParametros)
End If
Private Sub SeleccionaReporte(UrlParametros As Hashtable)
'DESCARGA DOCUMENTO XML O PDF DE LA FACTURA COMPRA
If UrlParametros("OP").ToString = "Fact" Then
DescargaFactura(UrlParametros)
@@ -518,11 +525,30 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/RepCortes.rdlc", lrds, params, "ReporteCortes", Formato)
End If
End Sub
End Sub
#End Region
#Region " OP = FACTURA - IMPRIME COMPRA"
Private Sub DescargaComprobante(Parametros As Hashtable)
If Parametros("COMPROBANTE") IsNot Nothing Then
Dim Path As String = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, Parametros("COMPROBANTE"))
Dim Archivo As New System.IO.FileInfo(Path)
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "application/octet-stream"
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
'HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
End If
Archivo = Nothing
End If
End Sub
Private Sub DescargaFactura(Parametros As Hashtable)
If Parametros("CVEFACTURA") IsNot Nothing AndAlso Parametros("CVEFACTURA").ToString.ToEntero > 0 Then
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")