microsoft / Dynamics365Commerce.Solutions

Repository for hosting the Dynamics 365 Commerce end to end sample solutions
Other
54 stars 26 forks source link

DLL not generating QR Code , while No documentation for using Microsoft.Dynamics.Commerce.Runtime.ReceiptsSaudiArabia.dll #200

Closed Ahmedbreaka closed 11 months ago

Ahmedbreaka commented 11 months ago

DLL not generating QR Code , while No documentation for using Microsoft.Dynamics.Commerce.Runtime.ReceiptsSaudiArabia.dll which included as out of the box in retail server in bin directory.

Summary

Describe the issue DLL not generating QR Code , it's logging that it's passed through the DLL but not generating QR Code, Documentation are out of date as it's describing Legacy Retail SDK not store commerce SDK and new independent SDK . https://learn.microsoft.com/en-us/dynamics365/commerce/localizations/mea/emea-sau-simplified-e-invoices#set-up-vat-per-saudi-arabian-requirements https://learn.microsoft.com/en-us/dynamics365/commerce/localizations/mea/emea-sau-qr-code?tabs=commerce-10-0-26

Version and Error Info Commerce SDK Component: Microsoft.Dynamics.Commerce.Runtime.ReceiptsSaudiArabia.dll Component Version: 9.46.23277 Exception/Error Details: The QR code is not generated. Correlation id: ec17eb86-3cbf-45f5-8b6e-f32c676f52ac, internal transaction id: 1bebc93d-c7fd-42e3-b3f0-4d2c99c4ead7. which mean QR Code not generated as in the code private static async Task GetQRCode(GetLocalizationCustomReceiptFieldServiceRequest request) { SalesOrder salesOrder = request.SalesOrder; string empty = String.Empty; Guid guid = Guid.NewGuid(); EventLogger.LogQrCodeGenerationStarted(guid, salesOrder.InternalTransactionId); ConfiguredTaskAwaitable configuredTaskAwaitable = GetSalesTransactionCustomReceiptFieldService.GetQrCodeContent(salesOrder, request.RequestContext, guid).ConfigureAwait(false); string str = await configuredTaskAwaitable; if (!String.IsNullOrEmpty(str)) { ConfiguredTaskAwaitable configuredTaskAwaitable1 = GetSalesTransactionCustomReceiptFieldService.EncodeQrCode(str, request.RequestContext).ConfigureAwait(false); EncodedQrCode encodedQrCode = await configuredTaskAwaitable1; if (!String.IsNullOrEmpty(encodedQrCode.QRcode)) { empty = String.Concat("<L:", encodedQrCode.QRcode, ">"); EventLogger.LogQrCodeGenerationFinished(guid, salesOrder.InternalTransactionId, encodedQrCode); } } if (String.IsNullOrEmpty(empty)) { EventLogger.LogQrCodeNotGenerated(guid, salesOrder.InternalTransactionId); } string str1 = empty; salesOrder = null; empty = null; return str1; }

Extension Requirement Please provide a concise description of the scenario you are trying to enable with this extension. This information is helpful for us to determine if there is an alternative implementation that avoids the issue.

Reproducing the Issue

Link to GitHub repo/solution where the issue is reproducible:

Steps to reproduce the behavior:

  1. Created Label as described in Language text page "QR code (SA)"

  2. Created Custom fields "INVOICEQRCODE_SA"

  3. Created Commerce parameters on the Configuration parameters tab QrCodeWidth , QrCodeHeight , RetailEInvoiceFeature_SA.QrCodeHeight, RetailEInvoiceFeature_SA.QrCodeWidth

  4. See error

Screenshots

Please include any screenshots that would help us understand the issue. image image image

Additional context

Are you following a sample that showcases this API? ,

madyke commented 11 months ago

Assigned internal tracking item to Globalization team to investigate.

JoyceShen-leshe commented 11 months ago

Please note the Warning section under https://learn.microsoft.com/en-us/dynamics365/commerce/localizations/mea/emea-sau-qr-code?tabs=commerce-10-0-26#enable-crt-extensions that it is not supported by Commerce SDK.

As the workaround to display QR code, you may disable the feature "KSA Electronic-Invoicing capability for the fiscal integration framework.". But for the long term, we would recommend follow the guidance to set up fiscal registration - https://learn.microsoft.com/en-us/dynamics365/commerce/localizations/mea/emea-sau-simplified-e-invoices#set-up-fiscal-registration, so that QR code can be generated from fiscal document.