Profile Specification - UBL 2.0 Invoice - DEMO

Profile definition for invoice messages based on UBL-Invoice-2.0.

CRITICALPhase 1: Preconditions

Preconditions for this test case. These condition must be fullfilled to continue to actual validation.

1.1 Message namespace: UBL-Invoice-2.0

Message root element shall have a namespace 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'.

1.2 Message root: Invoice

Message shall be based on UBL Invoice message format having a root element 'Invoice'.

1.3 UBL version provided

Message shall contain a non-empty UBL version ID.

1.4 UBL version: 2.0

Message shall be based on a version 2.0 of UBL Invoice message format.

1.5 Invoice type code

Message shall contain an invoice type code.

1.6 Invoice type code: 380 or 381

Invoice type code shall be either commercial invoice (380) or credit note (381).

1.7 Single message currency

Amounts shall be stated in a single currency.

CRITICALPhase 2: Base conditions

Validation for basic UBL message requirements. There is no point to continue validation if these requirements are not fulfilled.

2.1 Decimal separator

Dot shall be used as a decimal separator on UBL messages.

2.2 Date format

Date shall be presented using the format: YYYY-MM-DD.

MANDATORYPhase 3: Message structure

Validation against UBL-Invoice-2.0 W3C XML Schema provided by OASIS.

MANDATORYPhase 4: Mandatory information

Validation for elements/data which must exist on each Invoice message.

4.1 Message identifier

Message shall contain a message identifier.

4.2 Invoice issue date

Message shall contain an invoice issue date.

4.3 Supplier party

Message shall contain a supplier party.

4.4 Customer party

Message shall contain a customer party.

4.5 Line identifier

Invoice line shall contain a line identifier.

4.6 Line invoiced quantity

Invoice line shall contain an invoiced quantity.

4.7 Line invoiced item

Invoice line shall contain an invoiced item.

MANDATORYPhase 5: Format constraints

Validation for data format constraints.

5.1 Payment means code

Payment means code shall be based on UN/ECE 4461 codelist version D03A.

5.2 Allowance type

Allowance reason code shall be either trade discount "17" or deduction for late delivery "20".

MANDATORYPhase 6: Integrity constraints

Validation for integrity constraints.

6.1 Invoice issue date vs due date

Invoice due date shall be later than an invoice issue date.

6.2 Tax subtotal sum

Tax total shall match a sum of tax subtotals.

Phase must be passed to continue validation
Phase must be passed to pass the test successfully
Phase provides informative feedback on best practices etc.