[PEPPOL] Add PEPPOL SE localization: Swedish organisation number for endpoints under scheme 0007#8646
Conversation
PEPPOL BIS 3.0 scheme 0007 (SE:ORGNR) requires the 10-digit Swedish organisation number, but the EndpointID and PartyLegalEntity CompanyID carried the full 14-char VAT (SE...01), which access points reject (PEPPOL-COMMON-R049). Extract the organisation number for SE parties whose Country/Region VAT Scheme is 0007, leaving the PartyTaxScheme VAT identifier and all other countries unchanged. Add SE coverage to the PEPPOL BIS billing tests.
The new Swedish organisation-number branches used else-if, which AA0018 rejects. Split them so the if starts its own line, and document the keep-only-digits extraction in GetSwedishOrgNo.
|
Pushed
Also replied inline on the silent-fallback point. |
Copilot PR ReviewIteration 3 · Outcome: completed
Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
…ort test Validating a changed Country/Region Code on Company Information clears City, Post Code and County, so the SE export test failed the PEPPOL company checks with "City must have a value". Set City and Post Code after switching the company to SE. Test-only change.
|
Pushed |
|
I think the proper design is to create swedish localization, that implemetns the GetAccountingSupplierPartyInfo. So should be fairly trivial change. Long term better design choice. |
…ndpoints Move the Swedish organisation number handling from the shared W1 PEPPOL codeunit into a new PEPPOL SE localization app, following the PEPPOL DE pattern. The SE party info provider delegates to the W1 implementation and reduces endpoint and legal entity identifiers to the 10-digit organisation number when they are emitted under scheme 0007 (SE:ORGNR), leaving the party tax scheme VAT identifier and all other countries untouched. Default new PEPPOL 3.0 Setup records to the SE formats, add a PEPPOL SE test app covering the provider, and wire both apps into the SE build project.
|
@Groenbech96 Reworked as suggested in
The PR description is updated to match. |
Groenbech96
left a comment
There was a problem hiding this comment.
Great. Maybe consider install codeunit?
To set the SE versions oon the setup table that lives in W1.
Verify App Changes validates the country project settings against the group metadata, and the new apps were missing from groups.json. Register PEPPOL SE and PEPPOL SE Tests with the same group memberships as PEPPOL DE and PEPPOL Tests.
A setup record created before the PEPPOL SE app is installed never runs the OnAfterInsert subscriber, so existing SE tenants would stay on the W1 formats. Move an existing setup to the SE formats at install, but only from the W1 defaults so a deliberately configured format is kept.
|
@Groenbech96 Thanks! Both points addressed:
|
What and why
Swedish PEPPOL BIS 3.0 documents fail at the access point because the supplier/customer electronic address (
cbc:EndpointID) and thecac:PartyLegalEntity/cbc:CompanyIDare emitted as the full 14-character Swedish VAT number (for exampleSE733078715601) underschemeID="0007". Scheme0007is SE:ORGNR, which perPEPPOL-COMMON-R049must be exactly the 10-digit Swedish organisation number (7330787156).Per review feedback, the fix is implemented as a new PEPPOL SE localization app (
src/Apps/SE/PeppolSE), following the PEPPOL DE pattern, and the earlier changes to the shared W1 PEPPOL codeunit are fully reverted:PEPPOL 3.0 Formatenum extension addsPEPPOL 3.0 - SE SalesandPEPPOL 3.0 - SE Service, binding thePEPPOL Party Info Providerto a newPEPPOL30 SE Party Infocodeunit (standard W1 validation and iterator are reused).PEPPOL30implementation and post-processes only four of them: the endpoint identifiers are reduced to the 10-digit organisation number when the emittedschemeIDis0007, and the legal entity identifiers when the party's Country/Region VAT Scheme is0007. GLN setups (0088), Denmark (0184), and Swedish parties registered under EAS9955(SE:VAT, where the full VAT is correct) are untouched by construction.cac:PartyTaxScheme/cbc:CompanyID(BT-31/BT-48) keeps the full VAT number.PEPPOL 3.0 Setuprecords default to the SE formats on insert, mirroring PEPPOL DE. Existing setups keep their configured format; an install/upgrade step re-defaulting existing SE tenants can be added if preferred.PEPPOL SE Testsapp covers the provider through the enum interface dispatch, plus a posted sales invoice XML export.Note: for a blank bill-to country the country scheme falls back to the company's country, which is the same fallback the W1 implementation already uses to emit the endpoint
schemeID, so the value stays consistent with the declared scheme.Linked work
Fixes #7723
How I validated
EndpointIDandPartyLegalEntity/CompanyIDreturn7330787156under scheme00079955keeps the full VAT (not stripped)PartyTaxScheme/CompanyIDkeeps the full VATPEPPOL 3.0 Setupdefaults to the SE formatsPartyTaxSchemeRisk and compatibility
PEPPOL 3.0 Setup(defaulted for new setups in the SE localization).