Skip to content

PEPPOL FR improvements - #11096

Open
Milica Đukić (djukicmilica) wants to merge 13 commits into
microsoft:mainfrom
djukicmilica:private/milicadjukic/647916
Open

PEPPOL FR improvements#11096
Milica Đukić (djukicmilica) wants to merge 13 commits into
microsoft:mainfrom
djukicmilica:private/milicadjukic/647916

Conversation

@djukicmilica

@djukicmilica Milica Đukić (djukicmilica) commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Why

French PEPPOL exports need to meet partner feedback and French e-invoicing requirements for identifiers, billing profiles, regulatory comments, document references, and participant routing. The generated UBL must also preserve source order and delivery information when Extended CTC France is required.

Summary

  • Corrected the French and Extended CTC France customization identifiers and selected B1, S1, or M1 billing profiles from document line types.
  • Added Extended CTC line order references, shipment identifiers, delivery dates, and buyer references for invoices combining multiple orders, shipments, or delivery dates.
  • Updated supplier and buyer SIREN/SIRET identification and preserved configured electronic-address schemes, including service participant routing.
  • Added billing references for credit memos and removed zero-value allowance totals from generated XML.
  • Grouped regulatory comments by type so split comment lines produce one tagged UBL note without repeating the regulatory tag.
  • Expanded XML tests for identifiers, endpoints, buyer identification, billing modes, references, and regulatory-comment aggregation.

Fixes
AB#647916

@github-actions github-actions Bot added the From Fork Pull request is coming from a fork label Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link.

@github-actions github-actions Bot added Team: Finance GitHub request for Finance area ADO: Sync Creates an Azure DevOps work item if needed and indicates that one is linked labels Sep 5, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 5, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept with Suggestions

What this PR does

This PR updates the French PEPPOL export so the generated UBL uses the French customization identifiers, billing profiles, buyer and supplier identifiers, endpoint schemes, credit memo billing references, Extended CTC line references, delivery data, and grouped regulatory notes expected for French e-invoicing.

The approach is targeted to the French post-processing codeunit. The main branches look coherent: service participant routing wins before customer fallback, buyer legal identifiers are derived from SIREN/SIRET/French VAT data, and Extended CTC is selected only when the invoice has multiple order, shipment, or delivery-date evidence. The added XML tests cover the main changed paths.

Problem-solution fit

Fit: Strong

The bug describes missing or incorrect French e-invoicing identifiers, references, routing, and regulatory note handling. The diff addresses those cases directly in the FR PEPPOL export and adds focused tests for the expected XML output.

Suggestions

S1 (🟠 Moderate): Keep spaces between joined comment lines
When comments of the same regulatory type are joined, the code appends the next Comment directly to the previous text. Add a space or line break between rows unless one side already has whitespace, so split legal text cannot become one merged word in the exported note.

Risk assessment and necessity

Risk: The regression surface is limited to the French PEPPOL export XML. The risky parts are XML element order, changed customization IDs, endpoint scheme preservation, and using current customer/service-participant data for routing identifiers. The change does not post amounts, update ledger entries, change schema, or remove existing integration events; it adds one new integration event.

Necessity: The change is needed for French e-invoicing interoperability. The scope is appropriate because it keeps the behavior in the FR format layer and backs the main scenarios with XML assertions.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11096 round=1 by=alexei-dobriansky at=2026-09-06T01:10:57Z lastSha=861104cc22e61ec9e392262ef4144ae8a79d734d reviewKey=acdce258e86d01c6541ed07cb372bbfb62e5902074bfbd6f3efc8ea151fa6315 suggestions=S1@cb977c62

@djukicmilica

Copy link
Copy Markdown
Contributor Author

Addressed Good Sense suggestion S1 in ba98958: regulatory comment rows are trimmed and joined with exactly one space. The regression test now stores adjacent fragments without trailing or leading whitespace and verifies the exported PMD note preserves the word boundary.

Comment thread src/Apps/FR/EDocument_FR/EReportingFR/test/src/PEPPOLBIS30XMLTests.Codeunit.al Outdated
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 2

Recommendation: Request Changes

What this PR does

The new commits keep the French PEPPOL export updates and add the shipment external-document fallback for Extended CTC line references. They also fix the previous regulatory-comment spacing issue by joining non-empty trimmed fragments with one space.

The spacing fix is addressed, but the new cached buyer-reference path changes one edge case. A shipment can be part of an Extended CTC invoice without having a buyer reference, and the current lookup treats that missing optional value as an export error.

Problem-solution fit

Fit: Partial

The requested French PEPPOL behavior is mostly implemented, and the previous spacing issue is fixed. The buyer-reference cache does not preserve the valid blank-reference case, so the solution is not complete yet.

Status of previous suggestions
ID Title Status Author response
S1 Keep spaces between joined comment lines Addressed The new code trims each fragment, inserts one space between non-empty fragments, and adds a regression assertion.
New observations (commits since round 1)

S2 (🔴 High): Handle missing shipment buyer references
ShipmentBuyerReferences.Get(...) raises an error when the shipment has no stored buyer reference. This can fail export for an Extended CTC invoice even though delivery data can still be emitted without OrderLineReference. Capture the Boolean return and leave BuyerReference blank when the key is missing.

Risk assessment and necessity

Risk: The regression surface is limited to the French PEPPOL XML export. The new missing-key path can fail export for Extended CTC invoices that have shipments but no buyer reference on those shipments.

Necessity: The change is needed for French e-invoicing interoperability. The scope is still appropriate, but the buyer-reference cache must keep the previous blank-reference behavior instead of failing the export.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11096 round=2 by=alexei-dobriansky at=2026-09-06T13:28:01Z lastSha=655a894db5502e5d3a742c8ba300a12e5e41e454 reviewKey=3e03e59dd158d8a5c4800576b8c356aa997d15f40fd8e57e364ab5c78bf01f25 suggestions=S1@cb977c62:addressed,S2@8c556976:new parentRound=1

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟠\ High\ Severity\ —\ Testing}$

The new test hand-builds two "Sales Comment Line" fixtures with direct field assignment, hard-coded line numbers, and Insert calls even though "Library - Sales" already provides CreateSalesCommentLine and is used elsewhere in the same file. That bypasses the maintained test-library setup for valid comment lines and makes the scenario brittle to numbering or schema changes; create both comment lines through the library and then modify only the fields under test.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

        LibrarySales.CreateSalesCommentLine(SalesCommentLine, "Sales Document Type"::Invoice, InvoiceNo, 0);
        SalesCommentLine.Validate(Comment, OrdinaryCommentText);
        SalesCommentLine.Modify(true);
        LibrarySales.CreateSalesCommentLine(SalesCommentLine, "Sales Document Type"::Invoice, InvoiceNo, 0);
        SalesCommentLine.Validate("FR Regulatory Comment Type", SalesCommentLine."FR Regulatory Comment Type"::AAB);
        SalesCommentLine.Validate(Comment, CommentText);
        SalesCommentLine.Modify(true);

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.38.6

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 3

Recommendation: Request Changes

What this PR does

The latest changes keep the French PEPPOL export updates, make the customer electronic address scheme visible again, and change regulatory comment joining to trim fragments and append them directly. The buyer-reference issue from the previous round is still present, and the regulatory-comment separator issue is reintroduced.

Problem-solution fit

Fit: Partial

The requested French PEPPOL behavior is mostly implemented, but the Extended CTC shipment buyer-reference path can still fail for a valid blank-reference case. The regulatory-comment aggregation also still risks producing invalid text when comment lines need a word or sentence separator.

Status of previous suggestions
ID Title Status Author response
S1 Keep spaces between joined comment lines Not addressed No reply. The latest code removes the separator again and changes the test to expect direct concatenation.
S2 Handle missing shipment buyer references Not addressed No reply. The lookup still calls ShipmentBuyerReferences.Get(...) without using the Boolean return.
New observations (commits since round 2)

None - the new commit only changes the state of previous findings.

Risk assessment and necessity

Risk: The regression surface is limited to French PEPPOL XML export. A valid Extended CTC invoice can still fail when a shipment has no buyer reference, and grouped regulatory notes can still lose required spacing.

Necessity: The change is needed for French e-invoicing interoperability. The scope is appropriate, but the buyer-reference lookup must keep blank references safe before this can merge.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11096 round=3 by=alexei-dobriansky at=2026-09-06T19:02:24Z lastSha=73b9b3c3cf2c69bb18f9daa7d9bbe926d1625beb reviewKey=a7009ea4f4cbcaa2df5517aa914e0707c8a6ce42293cdbfd0f658ccd65119fde suggestions=S1@cb977c62:notaddressed,S2@8c556976:notaddressed parentRound=2

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 4

Recommendation: Accept with Suggestions

What this PR does

The latest change keeps the French PEPPOL export updates and fixes the Extended CTC shipment buyer-reference path. A shipment without a stored buyer reference now leaves the line reference blank instead of failing the export, while a shipment that has a reference can still add OrderLineReference.

The missing-key issue from the previous round is addressed by using the Boolean return from ShipmentBuyerReferences.Get(...). The remaining regulatory-comment issue is unchanged: comment fragments of the same type are still appended without any separator.

Problem-solution fit

Fit: Partial

The main French PEPPOL requirements are implemented, and the Extended CTC blank-reference case is now handled. The regulatory-comment aggregation still does not fully preserve readable text when one tagged comment is split across multiple rows.

Status of previous suggestions
ID Title Status Author response
S1 Keep spaces between joined comment lines Not addressed No reply. The current code still appends trimmed comment fragments directly without a separator.
S2 Handle missing shipment buyer references Addressed The new code uses the Boolean Get result and clears the reference when the shipment key is missing. A regression test exports an invoice where one shipment has no buyer reference.
New observations (commits since round 3)

None - the new commit only fixes the missing shipment buyer-reference path.

Risk assessment and necessity

Risk: The regression surface is limited to French PEPPOL XML export. The fixed shipment lookup no longer blocks valid Extended CTC invoices with a blank shipment reference. The open risk is that grouped regulatory notes can still merge words or sentences when the text is split across comment lines.

Necessity: The change is needed for French e-invoicing interoperability. The scope remains appropriate because it stays in the French format layer and the latest fix is narrow.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11096 round=4 by=alexei-dobriansky at=2026-09-07T13:26:09Z lastSha=e47ff52cc6432bba6b30a74634ff3b7c678af535 reviewKey=49d2ba24ad7a0fba3a087f4556cf6028b4156b1756a355233884d2e34778f284 suggestions=S1@cb977c62:notaddressed,S2@8c556976:addressed parentRound=3

@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Sep 7, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 5

Recommendation: Request Changes

What this PR does

The latest commits keep the French PEPPOL export changes, refine the shipment buyer-reference regression test so it checks the correct invoice line, and add data-classification registration for e-document messages.

The shipment buyer-reference test now matches the fixed behavior from the previous round. The regulatory-comment issue is still open, and the latest test edit introduces a new analyzer warning that makes the FR build fail.

Problem-solution fit

Fit: Partial

The main French PEPPOL requirements are mostly implemented, and the blank shipment-reference case is now covered more precisely. The solution is not merge-ready because one existing text-joining issue remains and the current branch does not pass the required FR build checks.

Status of previous suggestions
ID Title Status Author response
S1 Keep spaces between joined comment lines Not addressed No reply. The current code still appends trimmed comment fragments directly without a separator.
S2 Handle missing shipment buyer references Addressed The line-specific assertion confirms the shipment that has a buyer reference exports that reference, while another shipment may remain blank.
New observations (commits since round 4)

S3 (🔴 High): Fix the new AA0217 build warning
The new StrSubstNo call uses the XPath as an inline format string, and the FR Default and Clean builds now fail with AA0217. Move the XPath format to a locked label or text constant before calling StrSubstNo, so the PR can pass the required build checks.

Risk assessment and necessity

Risk: The latest production change is limited to data-classification setup, and the test-only XPath change does not affect runtime XML output. The current merge risk is practical: the FR build is failing, and grouped regulatory notes can still merge words or sentences when one legal note is split across comment lines. No BaseApp publisher dependency or Sales/Purchase/Service parallel change was introduced in this round.

Necessity: The French PEPPOL updates are needed for e-invoicing interoperability, including identifiers, routing, billing references, delivery data, and Extended CTC France output. The scope is still appropriate for the French format layer, but the build warning must be fixed before merge.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11096 round=5 by=alexei-dobriansky at=2026-09-08T01:14:41Z lastSha=5cce3113146ec085d0f9d5f7ed57571220bcb871 reviewKey=9f1bf4f12b12bb123a69e54a7acdbec3bf3d38d39a76431c42d9881259f445eb suggestions=S1@cb977c62:notaddressed,S2@8c556976:addressed,S3@93ec66f1:new parentRound=4

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 6

Recommendation: Request Changes

What this PR does

The latest commit only moves the invoice-line XPath format string from inline text to a locked label in the PEPPOL FR tests. That matches the previous build-warning fix and does not change runtime XML output.

The branch now passes the FR build checks that were failing before. One previous runtime issue remains: split regulatory comments of the same type are still trimmed and appended without any separator, so two parts of one legal note can be merged into one word or sentence.

Problem-solution fit

Fit: Partial

The French PEPPOL requirements are mostly covered, and the latest test-only change fixes the build-warning problem. The solution is still not merge-ready because the regulatory-comment joining behavior can change the legal text that is exported.

Status of previous suggestions
ID Title Status Author response
S1 Keep spaces between joined comment lines Not addressed No reply. The current code still appends each trimmed comment fragment directly, without a space or line break.
S2 Handle missing shipment buyer references Addressed The current tests keep the line-specific check for the shipment that has a buyer reference, while allowing another shipment to stay blank.
S3 Fix the new AA0217 build warning Addressed The XPath format is now stored in a locked label before StrSubstNo, and the current FR Default and Clean build checks are successful.
New observations (commits since round 5)

None - the only new changed span is the test label used by StrSubstNo, and it matches the required build-warning fix.

Risk assessment and necessity

Risk: The latest commit is test-only, so it does not add runtime regression risk. The remaining risk is in the FR PEPPOL export: grouped regulatory notes can still merge words or sentences when one required legal note is split over multiple sales comment lines. No BaseApp publisher dependency or Sales/Purchase/Service parallel change was introduced in this round.

Necessity: The French PEPPOL updates are needed for e-invoicing interoperability, including identifiers, routing, billing references, delivery data, and Extended CTC France output. The latest build fix was necessary, but the exported regulatory note text still needs a separator-safe join before merge.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11096 round=6 by=alexei-dobriansky at=2026-09-08T14:55:59Z lastSha=161dfbe982b9b0a37c2b8fb8eeccaab0444d046f reviewKey=8d394ce31f4f64cddd5b040b86e76b4c9d912149e826557af787639bfd855c5f suggestions=S1@cb977c62:notaddressed,S2@8c556976:addressed,S3@93ec66f1:addressed parentRound=5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ADO: Sync Creates an Azure DevOps work item if needed and indicates that one is linked AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants