Dear Team,
I have created below code to generate QR code and print on sales invoice. I'm working on business central cloud India localization. After scanning QR code on invoice, Getting error Message "Unable to verify Qr code as Digital signature is invalid". Can anyone suggest me how i can achieve this?
local procedure GenerateQRCode(SalInvHeader: Record "Sales Invoice Header"; SignQr: Text)
var
BarcodeSymbology2D: Enum "Barcode Symbology 2D";
BarcodeFontProvider2D: Interface "Barcode Font Provider 2D";
BarcodeString: Text;
QRCode: Text;
os: OutStream;
Mystream: InStream;
EinvoiceLedger: Record EInvoiceLedgerEntries;
Os_iIN: OutStream;
Is_iIN: InStream;
TempBlob: Codeunit "Temp Blob";
QRgenerator: Codeunit "QR Generator";
begin
QRCode := SignQr;
TempBlob.CreateInStream(Is_iIN);
QRgenerator.GenerateQRCodeImage(QRCode, TempBlob);
SalInvHeader."QR Code".CreateOutStream(os);
CopyStream(os,Is_iIN);
SalInvHeader.Modify();
EinvoiceLedger.Reset();
EinvoiceLedger.SetRange("Document No", SalInvHeader."No.");
if EinvoiceLedger.FindFirst() then begin
// EinvoiceLedger.QR
QRCode := SignQr;
TempBlob.CreateInStream(Is_iIN);
QRgenerator.GenerateQRCodeImage(QRCode, TempBlob);
EinvoiceLedger.QR.CreateOutStream(os);
CopyStream(os,Is_iIN);
EinvoiceLedger.Modify();
end;
end;