Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate line total #350

Open
jstaerk opened this issue Jun 15, 2023 · 6 comments
Open

Validate line total #350

jstaerk opened this issue Jun 15, 2023 · 6 comments

Comments

@jstaerk
Copy link

jstaerk commented Jun 15, 2023

https://unece.org/fileadmin/DAM/uncefact/BRS/BRS_CII_v2.0.6.pdf INV-176 says the line item amount should be quantity * net amount (+ charges - allowances).
image001

I've seen invoices in the wild which were miscalculated.
This is an anonymized where a line for 86.12 is just claimed to be worth 10€ straight and which does not, but should raise an error:

factur-x.txt

@AndreasPvd
Copy link
Contributor

The proposed calculation is incomplete as it does not include e.g. the PriceBaseUnit. A harmonised standard on invoice line calculation is needed that includes, for instance, the requirements of the energy sector as well. The complete invoice syntaxes (CII as well as UBL) provide for this reason additional calculation elements that are (currently) not supported by the EN16931.
For this reason, it is currently not possible to define a correct invoice-amount calculation based on the EN16931 provided information fields that is applicable to many big industries.

First the EN16931 should be amended to support the necessary information – then a harmonised calculation scheme should be defined and then implemented.

@jstaerk
Copy link
Author

jstaerk commented May 7, 2024

The proposed calculation is incomplete as it does not include e.g. the PriceBaseUnit. A harmonised standard on invoice line calculation is needed that includes, for instance, the requirements of the energy sector as well. The complete invoice syntaxes (CII as well as UBL) provide for this reason additional calculation elements that are (currently) not supported by the EN16931.

What are these additional calculation elements? If they are relevant to me it would sound as if they may be business requirements?

@csautereau
Copy link

For the time being, there is no calculation rule on line level in EN16931. It has been withdrawn because of rounding issues for too much companies.

The initial rule was BT-131 = Net Unit Price (BT-146) / BT-149 (base quantity for Unit Price) * Invoices Quantity (BT-129) + sum of Line Charges (sum of BT-141) - Sum of line Allowances (sum of BT-136)

And Net Unit Price = Gros Unit Price (BT-148) - Discount on Unit Price (BT-147)

@csautereau
Copy link

In addition, in the BRS document Gross price means Unit Price including VAT.
We also need to handle invoices calculated based on Unit Prices including VAT (as it exists on B2C).

In EDIFACT, if I remember well, It is said somewhere that the calculation is based on Gross Unit Price (which means that all VAT calculation is different, with a mathematical rounding issue of 1 cent maximum each time a VAT is calculated).

EN16931 was designed only for B2B / B2G invoices where Unit Prices are not including VAT, and VAT is calculated on document level only.

@jstaerk
Copy link
Author

jstaerk commented Sep 16, 2024

Thanks for the explanation

@SimonsPaul
Copy link
Collaborator

A validation rule for BT-131 will be added in the Revised EN16931-1.

Changing the current version of the EN16931-1 is not possible.

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

No branches or pull requests

6 participants