This document describes rules common to all EHF (Norwegian: Elektronisk Handelsformat; EHF) formats.
Reporting bugs
Please use Github Issues to report bugs and lack of content when discovered.
Users currently not registered on Github may create an account for free.
|
Introduction
EHC Common is a set of common rules applying to all document types part of EHF in Post-Award.
This document functions as a reference for each of the rules.
1. Changelog
1.1. Version 1.x
Version 1.0.5 (2019-02-27)
Issue | Description | Type |
---|---|---|
Fixing calculation error in rule EHF-COMMON-R050 for GLN identifiers with 0 (zero) as check digit. |
Validator |
Validation rules expected to be updated to trigger error in next release: EHF-COMMON-R005 |
Version 1.0.4 (2018-11-15)
Issue | Description | Type |
---|---|---|
- |
Adding rule EHF-COMMON-R005. |
Validator |
Validation rules expected to be updated to trigger error in next release: EHF-COMMON-R005 |
Version 1.0.3 (2018-09-12)
Issue | Description | Type |
---|---|---|
Change rule EHF-COMMON-R050 to trigger with error. |
Validator |
Version 1.0.2 (2018-02-20)
Issue | Description | Type |
---|---|---|
Adding tax categories "AE" and "G". |
Validator |
|
Adding rule to trigger upon multiple Note elements. |
Validator |
Validation rules expected to be updated to trigger error in next release: EHF-COMMON-R050 |
2. Rules
2.1. R00X - Document in general
2.1.1. EHF-COMMON-R001
Context |
|
---|---|
Rule |
|
Message |
Document MUST not contain empty elements. |
Type |
Error |
Since |
1.0.0 |
Elements in UBL used by EHF may be divided into two groups; those containing elements (
) and those containing values (cac
). This rule verifies there are no elements for values being empty.cbc
Elements without content are expected to be removed as long as they are optional. Mandatory elements must contain a valid value.
<cbc:ID></cbc:ID>
<cbc:ID/>
<cbc:ID>3150jd</cbc:ID>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.1.2. EHF-COMMON-R002
Context |
|
---|---|
Rule |
|
Message |
Document MUST not contain empty elements. |
Type |
Error |
Since |
1.0.0 |
Elements in UBL used by EHF may be divided into two groups; those containing elements (
) and those containing values (cac
). This rule verifies there are no elements for child elements being empty.cbc
Elements without child elements are expected to be removed as long as they are optional. Mandatory elements must contain child elements according to the specification.
<cac:ExternalReference>
</cac:ExternalReference>
<cac:ExternalReference>
<cbc:URI>https://vefa.difi.no/</cbc:URI>
</cac:ExternalReference>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.1.3. EHF-COMMON-R003
Context |
|
---|---|
Rule |
|
Message |
Document SHOULD not contain schema location. |
Type |
Warning |
Since |
1.0.0 |
<ApplicationResponse
xmlns="urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" (1)
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2 UBL-ApplicationResponse-2.1.xsd"> (2)
1 | Namespace for XML Schema Instance (XSI). |
2 | Pointer towards location of XSD. |
<ApplicationResponse
xmlns="urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.1.4. EHF-COMMON-R004
Context |
|
---|---|
Rule |
|
Message |
Document MUST have a syntax identifier. |
Type |
Error |
Since |
1.0.0 |
All UBL 2.x document types contains a
element as first element to help parsers to know which version of UBL was used by the document creater.
This is important as newer minor versions of UBL 2.x may contain new elements, meaning a document instance created using UBL 2.1 may not be parseable using the UBL 2.0 schema.UBLVersionID
We have made
mandatory as we want to be a good citizen in the UBL community.UBLVersionID
<Catalogue ...>
<!-- Content not containing element "UBLVersionID" -->
</Catalogue>
<Catalogue ...>
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
<!-- Content -->
</Catalogue>
EHF document type | UBL version |
---|---|
EHF Catalogue 1.x |
2.1 |
EHF Catalogue Response 1.x |
2.1 |
EHF Credit Note 2.x |
2.1 |
EHF Despatch Advice 1.x |
2.1 |
EHF Invoice 2.x |
2.1 |
EHF Order 1.x |
2.1 |
EHF Order Response 1.x |
2.1 |
EHF Reminder 1.x |
2.0 |
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.1.5. EHF-COMMON-R005
Context |
|
---|---|
Rule |
|
Message |
Attributes MUST contain value. |
Type |
Warning |
Since |
1.0.4 |
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.2. R01X - Validation of Norwegian organization numbers
2.2.1. EHF-COMMON-R010
Context |
|
---|---|
Rule |
|
Message |
MUST be a valid Norwegian organization number. Only numerical value allowed |
Type |
Error |
Since |
1.0.0 |
<cbc:EndpointID schemeID="NO:ORGNR">999 999 999</cbc:EndpointID>
<cbc:EndpointID schemeID="NO:ORGNR">810418052</cbc:EndpointID>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.2.2. EHF-COMMON-R011
Context |
|
---|---|
Rule |
|
Message |
When scheme is NO:ORGNR, a valid Norwegian organization number must be used. Only numerical value allowed |
Type |
Error |
Since |
1.0.0 |
<cac:PartyIdentification>
<cbc:ID schemeID="NO:ORGNR">999 999 999</cbc:ID>
</cac:PartyIdentification>
<cac:PartyIdentification>
<cbc:ID schemeID="NO:ORGNR">810418052</cbc:ID>
</cac:PartyIdentification>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.2.3. EHF-COMMON-R012
Context |
|
---|---|
Rule |
|
Message |
A VAT number MUST be valid Norwegian organization number (nine numbers) followed by the letters MVA. |
Type |
Error |
Since |
1.0.0 |
<cac:PartyTaxScheme>
<cbc:CompanyID schemeID="NO:VAT">999 999 999 MVA</cbc:CompanyID>
</cac:PartyTaxScheme>
<cac:PartyTaxScheme>
<cbc:CompanyID schemeID="NO:VAT">810418052MVA</cbc:CompanyID>
</cac:PartyTaxScheme>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Ignored |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Ignored |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Ignored |
2.2.4. EHF-COMMON-R013
Context |
|
---|---|
Rule |
|
Message |
When scheme is NO:ORGNR, a valid Norwegian organization number must be used. Only numerical value allowed |
Type |
Error |
Since |
1.0.0 |
<cac:PartyLegalEntity>
<cbc:CompanyID schemeID="NO:ORGNR">999 999 999</cbc:CompanyID>
</cac:PartyLegalEntity>
<cac:PartyLegalEntity>
<cbc:CompanyID schemeID="NO:VAT">810418052</cbc:CompanyID>
</cac:PartyLegalEntity>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Ignored |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Ignored |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Ignored |
2.2.5. EHF-COMMON-R014
Context |
|
---|---|
Rule |
|
Message |
An endpoint identifier scheme MUST have the value 'NO:ORGNR'. |
Type |
Error |
Since |
1.0.0 |
<cbc:EndpointID>810418052</cbc:EndpointID>
<cbc:EndpointID schemeID="NO:ORGNR">810418052</cbc:EndpointID>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.3. R02X - Validation of tax
2.3.1. EHF-COMMON-R020
Context |
|
---|---|
Rule |
|
Message |
Tax categories MUST be one of the follwoing codes: AA E H K R S Z |
Type |
Error |
Since |
1.0.0 |
<cac:TaxCategory>
<cbc:ID>A</cbc:ID>
</cac:TaxCategory>
<cac:TaxCategory>
<cbc:ID>AA</cbc:ID>
</cac:TaxCategory>
VAT category | Description | Rate as of January 1, 2016 |
---|---|---|
S |
Output VAT, regular rate |
25% |
H |
Output VAT, reduced rate, middle |
15% |
R |
Output VAT, reduced rate, raw fish |
11,11% |
AA |
Output VAT, reduced rate, low |
10% |
E |
VAT excempt |
0% |
Z |
VAT excempt (Goods and services not included in the VAT regulations) |
0% |
K |
Emission allowances for private or public businesses – buyer calculates VAT |
0% |
AE |
Reversed VAT |
0% |
G |
Export of goods and services |
0% |
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Ignored |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Ignored |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.4. R03X - Formating validation
2.4.1. EHF-COMMON-R030
Context |
|
---|---|
Rule |
|
Message |
A date must be formatted YYYY-MM-DD. |
Type |
Error |
Since |
1.0.0 |
<cbc:IssueDate>2017-01-01Z</cbc:IssueDate>
<cbc:IssueDate>2017-01-01</cbc:IssueDate>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.5. R04X - Validation of other identifiers
2.5.1. EHF-COMMON-R040
Context |
|
---|---|
Rule |
|
Message |
Invalid GLN number provided. |
Type |
Warning |
Since |
1.0.0 |
<cac:PartyIdentification>
<cbc:ID schemeID="GLN">6291041500212</cbc:ID>
</cac:PartyIdentification>
<cac:PartyIdentification>
<cbc:ID schemeID="GLN">6291041500213</cbc:ID>
</cac:PartyIdentification>
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Ignored |
|
EHF Catalogue Response 1.x |
Ignored |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.6. R05X - Validation of text elements
2.6.1. EHF-COMMON-R050
Context |
|
---|---|
Rule |
|
Message |
Only one note element is allowed. |
Type |
Error |
Since |
1.0.2 |
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Active |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Active |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Active |
2.7. R1XX - Code lists
2.7.1. EHF-COMMON-R100
Context |
|
---|---|
Rule |
|
Message |
Attachment is not a recommended MIMEType. |
Type |
Warning |
Since |
1.0.0 |
Document type | Status | Comment |
---|---|---|
EHF Catalogue 1.x |
Active |
|
EHF Catalogue Response 1.x |
Ignored |
|
EHF Credit Note 2.x |
Active |
|
EHF Despatch Advice 1.x |
Ignored |
|
EHF Invoice 2.x |
Active |
|
EHF Order 1.x |
Active |
|
EHF Order Response 1.x |
Ignored |
3. Appendix
Appendix A: Schematron
Validation files based on Schematron may be found in our Github repoistory. Release "2021-02-15" is used for the current version of resources and branch "master" is for development and review.
Difi provides validation artifacts as Schematron and not as XSLT as of release 2016-11-15.