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