Commit b0895f4
PEPPOL 3.0 1P App (#5126)
New first party app for using PEPPOL to export sales and service
documents.
This only adds the app, next steps would be integration with existing
steps in Base-app.
# Architecture
Design Pattern: Strategy via Enum + Interfaces
The core design uses an extensible enum (PEPPOL 3.0 Format) that
implements 11 specialized interfaces. This allows:
Polymorphic behavior based on document type (Sales vs Service)
Clean separation of concerns across different functional areas
Extensibility for future document types or formats
┌─────────────────────────────────────────────────────────────────────┐
│ PEPPOL 3.0 Format (Enum) │
│ ┌─────────────────────┐ ┌─────────────────────────────────┐ │
│ │ PEPPOL 3.0 - Sales │ │ PEPPOL 3.0 - Service │ │
│ └─────────────────────┘ └─────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────┐ ┌─────────────────────────────────┐ │
│ │ Sales Validation │ │ Service Validation │ │
│ │ Sales Export Mgmt │ │ Services Export Mgmt │ │
│ └─────────────────────┘ └─────────────────────────────────┘ │
│ │
│ Default Implementation (shared): PEPPOL30 Management │
│ - Attachment Handler, Delivery Info, Document Info, Line Info │
│ - Monetary Info, Party Info, Payment Info, Tax Info │
│ - Posted Document Iterator │
└─────────────────────────────────────────────────────────────────────┘<html>
## Interfaces
<img width="909" height="507" alt="image"
src="https://github.com/user-attachments/assets/15d1c825-a5a1-4e25-89a1-431007c7d9c1"
/>
## Folder Structure
App/
├── app.json # App manifest (ID range: 37200-37300)
└── src/
├── Management/ # Core shared logic
│ ├── Codeunits/
│ │ ├── PEPPOL30Management.Codeunit.al # Public facade (implements 9
interfaces)
│ │ ├── PEPPOL30ManagementImpl.Codeunit.al # Internal implementation
│ │ ├── PEPPOL30SalesValidation.Codeunit.al # Sales validation
(implements PEPPOL30 Validation)
│ │ ├── PEPPOL30ServiceValidation.Codeunit.al # Service validation
(implements PEPPOL30 Validation)
│ │ ├── PEPPOL30ValidationImpl.Codeunit.al # Shared validation logic
(Internal)
│ │ ├── PEPPOL30Initialize.Codeunit.al # Electronic Document Format
registration
│ │ └── PEPPOL30Install.Codeunit.al # Install codeunit
│ ├── Enums/
│ │ └── PEPPOL30Format.Enum.al # Central polymorphic enum
│ └── Interfaces/ # 11 interface definitions
│
├── Sales/ # Sales-specific functionality
│ ├── Codeunits/
│ │ ├── ExpSalesInvPEPPOL30.Codeunit.al # Sales Invoice export entry
point
│ │ ├── ExpSalesCrMPEPPOL30.Codeunit.al # Sales Credit Memo export entry
point
│ │ └── PEPPOL30SalesExportMgmt.Codeunit.al # Sales export management
(implements PEPPOL30 Export Management)
│ └── XmlPorts/
│ ├── SalesInvoicePEPPOL30.XmlPort.al # Invoice UBL XML generation
│ └── SalesCrMemoPEPPOL30.XmlPort.al # Credit Memo UBL XML generation
│
├── Services/ # Service-specific functionality
│ └── Codeunits/
│ ├── ExpServInvPEPPOL30.Codeunit.al # Service Invoice export entry
point
│ ├── ExpServCrMPEPPOL30.Codeunit.al # Service Credit Memo export entry
point
│ └── PEPPOL30ServicesExportMgmt.Codeunit.al # Service export management
(implements PEPPOL30 Export Management)
│
└── Setup/ # Configuration
├── CompanyInformation.TableExt.al # Adds PEPPOL format selection fields
└── CompanyInformation.PageExt.al # UI for format selection
Test/
├── app.json
└── src/
└── PEPPOL30ManagementTests.Codeunit.al # Comprehensive test coverage
## Key Components
1. Format Selection (Company Information)
Two new fields allow configuration of PEPPOL format per document type:
- PEPPOL 3.0 Sales Format - Format for Sales Invoices and Credit Memos
- PEPPOL 3.0 Service Format - Format for Service Invoices and Credit
Memos
**This could be changed to its own setup page.**
## How export works
Export Codeunit (e.g., Exp. Sales Inv. PEPPOL30)
│
├── 1. Get PEPPOL30 Validation interface from CompanyInfo format
│ └── Call ValidateInvoice() / ValidateCreditMemo()
│
├── 2. Call GenerateXMLFile()
│ └── Initialize XMLPort with format enum
│
└── 3. XMLPort uses interfaces for all data:
├── Document Info Provider → GetGeneralInfoBIS()
├── Party Info Provider → GetAccountingSupplierPartyInfo()
├── Tax Info Provider → GetTaxTotalInfo()
├── Export Management → FindNextRec(), FindNextLineRec()
└── ... (other providers)
This Pull request related with
microsoft/BusinessCentralApps#1595
Fixes
[AB#563709](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/563709)
---------
Co-authored-by: Andrius Andrulevičius <andrius.andrulevicius@companial.com>
Co-authored-by: Andrius Andrulevičius <30231314+AndriusAndrulevicius@users.noreply.github.com>
Co-authored-by: Grasiele Matuleviciute <131970463+GMatuleviciute@users.noreply.github.com>
Co-authored-by: Grasiele Matuleviciute <grasiele.matuleviciute@companial.com>
Co-authored-by: Magnus Hartvig Grønbech <magnushar@microsoft.com>1 parent 24fb48d commit b0895f4
38 files changed
Lines changed: 13658 additions & 0 deletions
File tree
- src/Apps/W1/PEPPOL
- App
- src
- Common
- Install
- Interfaces
- Sales
- XmlPorts
- Services
- Setup
- Test
- src
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
Large diffs are not rendered by default.
Lines changed: 378 additions & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
Lines changed: 1340 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments