Centrar generacion de pdf en el popUpVerFactura.aspx
This commit is contained in:
@@ -11021,6 +11021,10 @@ Partial Class Ventas
|
|||||||
|
|
||||||
ObjFactura.EsGarantia = Me.EsGarantia
|
ObjFactura.EsGarantia = Me.EsGarantia
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 AndAlso TrKilometraje.Visible Then
|
||||||
|
ObjFactura.Kilometraje = TxtKilometraje.Text.Trim.ToDecimal()
|
||||||
|
End If
|
||||||
|
|
||||||
'ASIGNAR RFC RECEPTOR
|
'ASIGNAR RFC RECEPTOR
|
||||||
If ObjFactura.Timbre IsNot Nothing Then
|
If ObjFactura.Timbre IsNot Nothing Then
|
||||||
If ObjFactura.Timbre.Receptor IsNot Nothing Then
|
If ObjFactura.Timbre.Receptor IsNot Nothing Then
|
||||||
@@ -14831,12 +14835,11 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'TIMBRADO NUEVO
|
'TIMBRADO NUEVO
|
||||||
Try
|
Try
|
||||||
PdfFactura(ObjFactura)
|
Dim ObjetoPDF As Byte() = DescargarFactura(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)
|
||||||
'If DdlTipoComprobante.SelectedValue = "Ing" Or DdlTipoComprobante.SelectedValue = "Ant" Then
|
|
||||||
' PdfFactura(ObjFactura)
|
If ObjetoPDF Is Nothing OrElse ObjetoPDF.Length = 0 Then
|
||||||
' 'Else
|
PdfFactura(ObjFactura, AplicaPagare:=If(ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant"), "1", "0"))
|
||||||
' ' pdf = PdfFactura(ObjFactura)
|
End If
|
||||||
'End If
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||||
@@ -14935,7 +14938,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'TIMBRADO NUEVO
|
'TIMBRADO NUEVO
|
||||||
Try
|
Try
|
||||||
pdf = PdfFactura(ObjFactura)
|
pdf = PdfFactura(ObjFactura, AplicaPagare:="1")
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||||
End Try
|
End Try
|
||||||
@@ -32987,27 +32990,27 @@ Partial Class Ventas
|
|||||||
|
|
||||||
' Return File
|
' Return File
|
||||||
'End Function
|
'End Function
|
||||||
'Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
|
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer, Optional GetBytes As Boolean = True) As Byte()
|
||||||
' Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
Dim Url = New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?P={3}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||||
' Dim File As Byte() = Nothing
|
Dim File As Byte() = Nothing
|
||||||
' Try
|
Try
|
||||||
' Using httpClient = New HttpClient()
|
Using httpClient = New HttpClient()
|
||||||
' httpClient.Timeout = New TimeSpan(0, 15, 0)
|
httpClient.Timeout = New TimeSpan(0, 2, 0)
|
||||||
' Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||||
' request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario=100", CveEmpresa, DateTime.UtcNow.Ticks)))
|
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo)))
|
||||||
' Dim response = httpClient.SendAsync(request).Result
|
Dim response = httpClient.SendAsync(request).Result
|
||||||
' If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then
|
If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then
|
||||||
' File = response.Content.ReadAsByteArrayAsync().Result
|
File = response.Content.ReadAsByteArrayAsync().Result
|
||||||
' End If
|
End If
|
||||||
' End Using
|
End Using
|
||||||
' End Using
|
End Using
|
||||||
' Catch ex As Exception
|
Catch ex As Exception
|
||||||
' File = Nothing
|
File = Nothing
|
||||||
' OnError("Ocurrió un error al descargar la factura", ex)
|
OnError("Ocurrió un error al descargar la factura", ex)
|
||||||
' End Try
|
End Try
|
||||||
|
|
||||||
' Return File
|
Return File
|
||||||
'End Function
|
End Function
|
||||||
Protected Sub LnkGenerarOC_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkGenerarOC_Click(sender As Object, e As EventArgs)
|
||||||
Response.Redirect($"~/OC/OC.aspx?CveCotizacion={Me.CveVenta}&Tipo=OC")
|
Response.Redirect($"~/OC/OC.aspx?CveCotizacion={Me.CveVenta}&Tipo=OC")
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user