Skip to content

Commit

Permalink
Merge pull request #55 from gflohr/23-override-customizationid-and-pr…
Browse files Browse the repository at this point in the history
…ofileid

23 Override CustomizationID and ProfileID
  • Loading branch information
gflohr authored Dec 12, 2024
2 parents 505852e + ca28099 commit 27f797c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 15 deletions.
81 changes: 68 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ formats or JSON.
- [E-Invoice-EU](#e-invoice-eu)
- [Status](#status)
- [Supported Formats](#supported-formats)
- [Other UBL and CII Variants](#other-ubl-and-cii-variants)
- [Missing Formats](#missing-formats)
- [Security](#security)
- [Description](#description)
- [Documentation](#documentation)
Expand All @@ -28,6 +30,7 @@ formats or JSON.
- [Create an Invoice from a Spreadsheet](#create-an-invoice-from-a-spreadsheet)
- [Full-Fledged Example](#full-fledged-example)
- [Data Structure](#data-structure)
- [Validation](#validation)
- [Mapping Syntax](#mapping-syntax)
- [Frequently Asked Questions](#frequently-asked-questions)
- [Why are no Numbers Used in the JSON Schema?](#why-are-no-numbers-used-in-the-json-schema)
Expand All @@ -37,7 +40,6 @@ formats or JSON.
- [BUGS](#bugs)
- [Report a Bug](#report-a-bug)
- [PDF/A](#pdfa)
- [Missing Invoice Formats](#missing-invoice-formats)
- [License](#license)

## Status
Expand Down Expand Up @@ -69,6 +71,49 @@ You can currently create invoices in these formats:

Case does not matter, when you specify a format.

### Other UBL and CII Variants

There are a lot of variants of UBL and CII in use. See
https://peppol.helger.com/public/locale-en_US/menuitem-validation-ws2
for an overview. The only real difference to the vanilla UBL and CII formats
generated by e-invoice-eu are a so called customization and sometimes also
a profile ID. If you have to support one of these formats, all you have to
do is to specify "UBL" or "CII" as the format and provide the respective values
either in the invoice data or hardcode them into your mapping.

Hardcoding them into the mapping is easy:

```yaml
# ...
ubl: Invoice
cbc:CustomizationID: urn:cen.eu:en16931:2017#conformant#urn:fdc:peppol.eu:2017:poacc:billing:international:aunz:3.0
cbc:ProfileID: urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
# ...
```

This would for example create an A-NZ Peppol BIS3 Invoice 1.0.11 UBL invoice.
Note that you always have to specify exactly these fields, even for CII
variants. The ids will be mapped into their respective CII counterparts by the
service.

The formats "XRechnung-UBL" and "XRechnung-CII" are just convenience formats
for Germany. The only difference to vanilla UBL and vanilla CII are the
customization IDs. If you think that another format should also be added for
convenience, file an issue.

It is the user's responsability to meet other requirements of that variant.
For example XRechnung-UBL requires that the otherwise optional field
`/ubl:Invoice/cbc:BuyerReference` (BT-10) is filled. This is something that
you have to ensure yourself in order to create a valid invoice.

### Missing Formats

Credit notes and other documents like orders are currently not supported and
support for it will require more effort.

EDI is also not supported. If you know of a tool that is able to convert
UBL or CII to EDI, please let us know!

### Security

The service in its current state is meant to be run in a network with limited
Expand Down Expand Up @@ -269,6 +314,28 @@ https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/tree/
A gentler introduction can be found here:
https://docs.peppol.eu/poacc/billing/3.0/bis/

## Validation

The service `e-invoice-eu` will ensure that the _structure_ of the invoices
you generate meets the requirements of the standard. That means that it
ensures the correct number of occurences and the correct order of all elements.

It is _your_ responsability to ensure the business requirements to the
invoice. Example: The software ensures that the invoice contains the tax
total but it is your responsability to ensure that the tax total is the sum
of the individual tax amounts.

Most of these business requirements are defined in business rules and it is
possible to check these requirements. This is called validation. See
[the overview on validation](contrib/validators/README.md) for more details
and how you can validate your invoices locally or by uploading them to
an invoice portal.

You should not ignore this! When you start creating electronic invoices it is
almost inevitable that they will contain errors that are detected by a
validator. Such invoices will be rejected by your customers and that costs
time and money on both sides.

## Mapping Syntax

Please see the [mapping documentation](documentation/Mapping.md)!
Expand Down Expand Up @@ -351,18 +418,6 @@ On Un\*x systems, `libreoffice` should be in your `$PATH`. On MacOS, you will
find it under `/Applications/LibreOffice.app/Contents/MacOS/soffice`. On
MS Windows, it is probably somewhere like `C:\\Program Files\\LibreOffice\\libreoffice.exe` (corrections are welcome).

### Missing Invoice Formats

All invoice formats that are variants of UBL or CII should be relatively easy
to support. Please file an issue if you need an invoice format that is
currently not supported.

Credit notes and other documents like orders are currently not supported and
support for it will require more effort.

EDI is also not supported. If you know of a tool that is able to convert
UBL or CII to EDI, please let us know!

## License

This is free software available under the terms of the
Expand Down
4 changes: 2 additions & 2 deletions src/format/format-ubl.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export class FormatUBLService
}

fillMappingDefaults(mapping: Mapping) {
if (!('cbc:customizationID' in mapping['ubl:Invoice'])) {
if (!('cbc:CustomizationID' in mapping['ubl:Invoice'])) {
mapping['ubl:Invoice']['cbc:CustomizationID'] = this.customizationID;
}

if (!('cbc:profileID' in mapping['ubl:Invoice'])) {
if (!('cbc:ProfileID' in mapping['ubl:Invoice'])) {
mapping['ubl:Invoice']['cbc:ProfileID'] = this.profileID;
}
}
Expand Down

0 comments on commit 27f797c

Please sign in to comment.