Mejores en descarga de pdf de econo
This commit is contained in:
@@ -6040,7 +6040,7 @@ Public Class ClsPaginas
|
|||||||
If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then
|
If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then
|
||||||
Dim QRDescarga As String = ""
|
Dim QRDescarga As String = ""
|
||||||
Dim cfdi As New RVCFDI33.GeneraCFDI()
|
Dim cfdi As New RVCFDI33.GeneraCFDI()
|
||||||
Dim Parametros As String = Encripta($"CveVenta={Vta.CveVenta}&CveEmpresa={Vta.CveEmpresa}")
|
Dim Parametros As String = Encripta($"SerieFolio={Vta.SerieFolio}&TipoDocto={Vta.TipoDocto}&CveEmpresa={Vta.CveEmpresa}")
|
||||||
Dim b As Byte() = cfdi.ConvertirQrCode($"http://econollantas.adssistemas.mx/Ashx/E141.ashx?PV={Parametros}")
|
Dim b As Byte() = cfdi.ConvertirQrCode($"http://econollantas.adssistemas.mx/Ashx/E141.ashx?PV={Parametros}")
|
||||||
QRDescarga = Convert.ToBase64String(b)
|
QRDescarga = Convert.ToBase64String(b)
|
||||||
params.Add(New ReportParameter("QRDescarga", QRDescarga))
|
params.Add(New ReportParameter("QRDescarga", QRDescarga))
|
||||||
|
|||||||
@@ -99,16 +99,36 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Dim retorno As String = ""
|
Dim retorno As String = ""
|
||||||
Try
|
Try
|
||||||
Dim Params = If(context.Request("P") = Nothing, "", context.Request("P").ToString())
|
Dim Params = If(context.Request("P") = Nothing, "", context.Request("P").ToString())
|
||||||
|
Dim ParamsV = If(context.Request("PV") = Nothing, "", context.Request("PV").ToString())
|
||||||
|
|
||||||
|
Dim ParametrosNuevos As Boolean = False
|
||||||
|
If Not String.IsNullOrEmpty(ParamsV) Then
|
||||||
|
ParametrosNuevos = True
|
||||||
|
Params = ParamsV
|
||||||
|
End If
|
||||||
|
|
||||||
'DESCARGA DEL PDF
|
'DESCARGA DEL PDF
|
||||||
If Not String.IsNullOrEmpty(Params) Then
|
If Not String.IsNullOrEmpty(Params) Then
|
||||||
Try
|
Try
|
||||||
Dim UrlParametros As Hashtable = Parametros(Decripta(Params))
|
If ParametrosNuevos Then
|
||||||
|
Dim UrlParametros As Hashtable = Parametros(Decripta(Params))
|
||||||
|
|
||||||
Dim File As String = UrlParametros("FILE").ToString()
|
Dim File As String = String.Format("{0}.pdf", UrlParametros("SERIEFOLIO").ToString())
|
||||||
If Not String.IsNullOrEmpty(File) Then
|
Dim TipoDocto As String = UrlParametros("TIPODOCTO").ToString()
|
||||||
ImprimirbytesPDF(context, DescargarFactura(File), File)
|
Dim CveEmpresaParam As Integer = UrlParametros("CVEEMPRESA").ToString().ToEntero()
|
||||||
|
|
||||||
|
If Not String.IsNullOrEmpty(File) AndAlso Not String.IsNullOrEmpty(TipoDocto) AndAlso CveEmpresaParam > 0 Then
|
||||||
|
ImprimirbytesPDF(context, DescargarFactura(File, CveEmpresaParam, TipoDocto), File)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Dim UrlParametros As Hashtable = Parametros(Decripta(Params))
|
||||||
|
|
||||||
|
Dim File As String = UrlParametros("FILE").ToString()
|
||||||
|
If Not String.IsNullOrEmpty(File) Then
|
||||||
|
ImprimirbytesPDF(context, DescargarFactura(File, Me.CveEmpresa), File)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
GuardaLogAD("Ocurrió un error al descargar el pdf. " + ex.ToString() + ".parametros: " + Params, "LogE141")
|
GuardaLogAD("Ocurrió un error al descargar el pdf. " + ex.ToString() + ".parametros: " + Params, "LogE141")
|
||||||
End Try
|
End Try
|
||||||
@@ -2202,8 +2222,8 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
|
|
||||||
#Region "D E S C A R G A - P D F"
|
#Region "D E S C A R G A - P D F"
|
||||||
|
|
||||||
Private Function DescargarFactura(FilePDF As String) As Byte()
|
Private Function DescargarFactura(FilePDF As String, CveEmpresa As Integer, Optional TipoDocto As String = "Ing") As Byte()
|
||||||
Dim Url = New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?TipoDocto=Ing&File={3}&TipoArchivo=PDF", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, FilePDF))
|
Dim Url = New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?TipoDocto={4}&File={3}&TipoArchivo=PDF", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, FilePDF, TipoDocto))
|
||||||
Dim File As Byte() = Nothing
|
Dim File As Byte() = Nothing
|
||||||
Try
|
Try
|
||||||
Using httpClient = New HttpClient()
|
Using httpClient = New HttpClient()
|
||||||
|
|||||||
Reference in New Issue
Block a user