Correciones PDF Sali
This commit is contained in:
@@ -22,12 +22,11 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
|
||||
Public ReadOnly Property EsProduccion As Boolean
|
||||
Get
|
||||
Return False
|
||||
'If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
|
||||
' Return False
|
||||
'Else
|
||||
' Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1")
|
||||
'End If
|
||||
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
|
||||
Return False
|
||||
Else
|
||||
Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1")
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -160,7 +159,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
|
||||
Dim objxml As XmlSatCFDI = XmlSatCFDI.readXML(RutaXml)
|
||||
|
||||
Dim rutaReporte As String = "\Empresas\Grales\Formatos\FacturaSALI.rdlc"
|
||||
Dim rutaReporte As String = "Empresas\Grales\Formatos\FacturaSALI.rdlc"
|
||||
|
||||
Dim QR As ClbNegBICFDv3_2.ClsNegCBBGenerar = New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||
Dim cQr As Byte() = QR.GenerarCBBBytes(objxml.emisor.Rfc, objxml.receptor.Rfc, objxml.comprobante.Total, objxml.complemento.UUID)
|
||||
@@ -199,6 +198,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
parametros.Add(New ReportParameter("complemento_SelloSAT", objxml.complemento.SelloSAT))
|
||||
parametros.Add(New ReportParameter("complemento_UUID", objxml.complemento.UUID))
|
||||
parametros.Add(New ReportParameter("complemento_CadenaOriginal", objxml.complemento.CadenaOriginal))
|
||||
parametros.Add(New ReportParameter("Observaciones", datos.Factura.Observaciones))
|
||||
|
||||
|
||||
Dim ds As New List(Of ReportDataSource)
|
||||
@@ -222,34 +222,30 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
|
||||
ltotales.Add(New utilValores("Total", objxml.comprobante.Total.ToString("N2")))
|
||||
rdsTotales.Name = "dsTotales"
|
||||
rdsTotales.Value = ltotales
|
||||
rdsTotales.Value = ltotales.QueryToDataTable(True)
|
||||
ds.Add(rdsTotales)
|
||||
|
||||
Dim rds2 As ReportDataSource = New ReportDataSource()
|
||||
Dim limagenes As List(Of utilImage) = New List(Of utilImage)()
|
||||
limagenes.Add(New utilImage(cQr))
|
||||
rds2.Name = "dsImagenes"
|
||||
rds2.Value = limagenes
|
||||
rds2.Value = limagenes.QueryToDataTable(True)
|
||||
ds.Add(rds2)
|
||||
|
||||
Dim rdsrelacionados As ReportDataSource = New ReportDataSource()
|
||||
rdsrelacionados.Name = "dsRelacionados"
|
||||
rdsrelacionados.Value = objxml.cFDIRelacionados
|
||||
rdsrelacionados.Value = objxml.cFDIRelacionados.QueryToDataTable(True)
|
||||
ds.Add(rdsrelacionados)
|
||||
|
||||
Dim rds1 As ReportDataSource = New ReportDataSource()
|
||||
rds1.Name = "dsConceptos"
|
||||
rds1.Value = objxml.GetConceptosforpdf()
|
||||
rds1.Value = objxml.GetConceptosforpdf().QueryToDataTable(True)
|
||||
|
||||
ds.Add(rds1)
|
||||
|
||||
Try
|
||||
bytes = StreamPDF(context, rutaReporte, ds, parametros)
|
||||
bytes = StreamPDF(context, rutaReporte, ds, parametros)
|
||||
|
||||
System.IO.File.Delete(RutaXml)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
System.IO.File.Delete(RutaXml)
|
||||
|
||||
Return bytes
|
||||
|
||||
@@ -269,8 +265,8 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
|
||||
If EsProduccion Then
|
||||
|
||||
Dim CveUsuario As Integer = -1
|
||||
Dim CveEmpresa As Integer = -1
|
||||
Dim CveUsuario As Integer = 100
|
||||
Dim CveEmpresa As Integer = 1
|
||||
|
||||
Dim wsreport As New WSRDLC.WebServiceSoapClient
|
||||
Dim params As New List(Of WSRDLC.ReportParameter)
|
||||
@@ -285,12 +281,14 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
dt.TableName = rpds.Name
|
||||
ds.Tables.Add(dt)
|
||||
Next
|
||||
|
||||
For Each rpds As ReportParameter In Parametros
|
||||
Dim param As New WSRDLC.ReportParameter
|
||||
param.Name = rpds.Name
|
||||
param.Values = {rpds.Values(0)}
|
||||
params.Add(param)
|
||||
Next
|
||||
|
||||
Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario)
|
||||
wsreport = Nothing
|
||||
params = Nothing
|
||||
|
||||
Reference in New Issue
Block a user