--regenerar codigo QR en pdf
This commit is contained in:
@@ -5187,7 +5187,7 @@ Public Class ClsPaginas
|
||||
#End Region
|
||||
#Region "IMPRIMIR FACTURA"
|
||||
|
||||
Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing, Optional UsarStimul As Boolean = False) As Byte()
|
||||
Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing, Optional UsarStimul As Boolean = False, Optional RegenerarQR As Boolean = False) As Byte()
|
||||
Dim retorno As Byte() = Nothing
|
||||
' Dim ObjVentas As New ClsVentas
|
||||
'DATOS GENERALES
|
||||
@@ -5489,9 +5489,18 @@ Public Class ClsPaginas
|
||||
End If
|
||||
End If
|
||||
'Si no tiene CBB, SE GENERA
|
||||
If Not ImagenCBB.Exists AndAlso Vta.FolioFiscal <> "" Then
|
||||
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total, Vta.FolioFiscal, RutaCBB)
|
||||
If (Not ImagenCBB.Exists OrElse RegenerarQR) AndAlso Vta.FolioFiscal <> "" Then
|
||||
'Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
|
||||
'CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total, Vta.FolioFiscal, RutaCBB)
|
||||
Dim LigaVerificacionSAT As String = "https://verificacfdi.facturaelectronica.sat.gob.mx/default.aspx"
|
||||
Try
|
||||
Dim qrCode As New GoFac.QrCode()
|
||||
Dim bCBB As Byte() = qrCode.GenerarQrCode($"{LigaVerificacionSAT}?re={UsuarioActual.Empresa.RFC}&rr={RFCReceptor}&tt={String.Format("{0,12:F6}", Vta.Total).Trim()}&id={Vta.FolioFiscal}&fe={Vta.SelloCFDi.Substring(Vta.SelloCFDi.Length - 8, 8)}")
|
||||
File.WriteAllBytes(RutaCBB, bCBB)
|
||||
bCBB = Nothing
|
||||
Catch ex As Exception
|
||||
GuardaLog("Ocurrió un error al generar el QR." + ex.ToString())
|
||||
End Try
|
||||
End If
|
||||
'ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme.Replace("https", "http"), Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
|
||||
|
||||
|
||||
@@ -3297,7 +3297,7 @@ Partial Class PopUpVerFactura
|
||||
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
||||
GeneraPDFVtaPyMe(Vta, "PDF")
|
||||
Else
|
||||
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
|
||||
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte, RegenerarQR:=True), Vta.SerieFolio, "PDF")
|
||||
Vta = Nothing
|
||||
End If
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user