Skip to content

[Bug]: [W1][xmlport][37200][Sales Cr.Memo - PEPPOL30] empty BillingReference part when source data exist #10433

Description

@RadoArvay

Describe the issue

XMLport 37200 "Sales Cr.Memo - PEPPOL30" does not create BillingReference XML node (ubl:CreditNote/cac:BillingReference) in the XML file, even if the source record contains corresponding data ("Applies-to No." field is filled).
There is the code for BillingReference TextElement:

trigger OnBeforePassVariable()
var
    PEPPOLDocumentInfoProvider: Interface "PEPPOL Document Info Provider";
begin
    PEPPOLDocumentInfoProvider := GetFormat();
    PEPPOLDocumentInfoProvider.GetCrMemoBillingReferenceInfo(
    SalesCrMemoHeader,
      InvoiceDocRefID,
      InvoiceDocRefIssueDate);

    if InvoiceDocRefID = '' then
        currXMLport.Skip();
end;

For PEPPOLDocumentInfoProvider.GetCrMemoBillingReferenceInfo() calling, SalesCrMemoHeader variable is used, but this variable is always empty (never assigned or filled) and the standard interface implementation returns an empty InvoiceDocRefID variable and therefore currXMLport.Skip() is raised.

Expected behavior

SalesCrMemoHeader should be initialized. It is enough to fill just those 2 field needed in GetCrMemoBillingReferenceInfo before calling this method.

Steps to reproduce

Create e-document of credit meme type with Applies-to fields entered and export it.

Additional context

But - there is also an indirect issue with the current state:

Interface "PEPPOL Document Info Provider" contains GetCrMemoBillingReferenceInfo() method definition. This definition is inconsistent because it uses SalesCrMemoHeader parameter of Record "Sales Cr.Memo Header” type. All other methods in all Peppol interfaces use Record "Sales Header” types.

I think it should be reviewed and normalized by the Product team.

The solution would be:

  • add a new method definition GetBillingReferenceInfo() to interface "PEPPOL Document Info Provider"
  • prepare implementation in codeunit 37200 "PEPPOL30"
  • replace call of GetCrMemoBillingReferenceInfo in XMLport 37200 "Sales Cr.Memo - PEPPOL30"

There shouldn't be any breaking change, because codeunit "PEPPOL30" is default implementation for the interface in enum 37200 "PEPPOL 3.0 Format".

I will provide a fix for a bug

  • I will provide a fix for a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    IntegrationGitHub request for Integration area

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions