microsoft / microsoft/BCApps

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

Open
#10,433 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team: Integrations
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with XMLport 37200 "Sales Cr.Memo - PEPPOL30" and trace the BillingReference TextElement and its OnBeforePassVariable trigger. Then review interface "PEPPOL Document Info Provider" and codeunit 37200 "PEPPOL30", including GetCrMemoBillingReferenceInfo. Done means the exported credit memo includes BillingReference when Applies-to No. is populated, with the interface consistency reviewed.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.