Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

Belgium PEPPOL requires two deviations from W1: VAT registration numbers must use FormatEnterpriseNo for BE companies, and document validation must accept "Enterprise No." as alternative to GLN/VAT Registration No.

Changes

New App: src/Apps/BE/Peppol

PEPPOL Party Info Provider Implementation (PEPPOL30 BE)

  • Overrides all methods that internally call FormatVATRegistrationNo to use BE-specific logic
  • For BE countries, applies FormatEnterpriseNo which prepends ISO code only to numeric-only enterprise numbers
if IsBelgiumCountry(CountryCode) then
    VATRegistrationNo := FormatEnterpriseNo(VATRegistrationNo, CountryCode)

Validation Implementation (PEPPOL30 BE Sales Validation)

  • Extends company/customer validation to include Enterprise No.:
if CompanyInfo.GLN + CompanyInfo."VAT Registration No." + GetEnterpriseNo(CompanyInfo) = '' then
    Error(MissingCompInfGLNOrVATRegNoOrEnterpNoErr, ...);
  • Integration events: OnCheckSalesDocumentOnBeforeCheckCompanyVATRegNo, OnCheckSalesDocumentOnBeforeCheckCustomerVATRegNo

Enum Extension (PEPPOL 3.0 Format BE)

  • Registers PEPPOL 3.0 - BE Sales and PEPPOL 3.0 - BE Service with BE implementations

Copilot AI and others added 2 commits January 23, 2026 16:53
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Copilot AI changed the title [WIP] Override GetAccountingSupplierPartyTaxScheme method for Peppol app Add BE Peppol app with Belgium-specific VAT registration formatting Jan 23, 2026
Copilot AI requested a review from Groenbech96 January 23, 2026 16:55
Copilot AI and others added 2 commits January 23, 2026 17:01
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Copilot AI changed the title Add BE Peppol app with Belgium-specific VAT registration formatting Add BE Peppol app with Enterprise No. validation and VAT formatting Jan 23, 2026
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Copilot AI changed the title Add BE Peppol app with Enterprise No. validation and VAT formatting Add BE Peppol localization with Enterprise No. support Jan 23, 2026
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
@Groenbech96
Copy link
Contributor

@copilot try again

@Groenbech96
Copy link
Contributor

@copilot try again

@Groenbech96
Copy link
Contributor

@copilot try again

@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Jan 26, 2026
@github-actions
Copy link

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

@Groenbech96 Groenbech96 marked this pull request as ready for review January 26, 2026 13:33
@Groenbech96 Groenbech96 requested review from a team as code owners January 26, 2026 13:33
PR #6268 implements BE-specific PEPPOL export (Enterprise No.
formatting/validation) but only for Sales documents. Service documents
would fall through to W1 implementation, missing Belgium Enterprise No.
support entirely.

## Changes

- **Added** `PEPPOL30 BE Service Validation` codeunit (37312) -
delegates to BE Sales validation via service→sales conversion (mirrors
W1 pattern)
- **Extended** `PEPPOL 3.0 Format BE` enum with `"PEPPOL 3.0 - BE
Service"` value (37311) implementing BE Party Info Provider + BE Service
Validation
- **Updated** subscriber to set both `"PEPPOL 3.0 Sales Format"` and
`"PEPPOL 3.0 Service Format"` on setup insert

## Format Selection Flow

```al
// Export codeunits read setup and dispatch to format implementation
Exp. Sales Inv. PEPPOL30   → Setup."PEPPOL 3.0 Sales Format"   → PEPPOL30 BE → FormatEnterpriseNo ✓
Exp. Serv.Inv. PEPPOL30    → Setup."PEPPOL 3.0 Service Format" → PEPPOL30 BE → FormatEnterpriseNo ✓
                                                            (was: PEPPOL30 W1 → No Enterprise No.)
```

Both document types now apply BE-specific:
- `FormatEnterpriseNo`: Prepends ISO code to numeric-only enterprise
numbers
- Validation: Accepts GLN **OR** VAT Reg No. **OR** Enterprise No. (W1
only accepts first two)

<!-- START COPILOT CODING AGENT SUFFIX -->



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> Pull Request: #6268
> 
> Please analyse how/if this app correctly overrides behaviour of the W1
app when user executes the export of sales or services docs.
> 


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
@Groenbech96
Copy link
Contributor

@copilot Error: Clashing object IDs detected: codeunit 37312
Exception: Object ID validation failed. When adding new test objects, ensure that their IDs are within the valid range and do not
clash with existing object IDs.
Error: Process completed with exit code 1.

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

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants