ConnectingEurope / eInvoicing-EN16931

Validation artefacts for the European eInvoicing standard EN 16931
Other
138 stars 54 forks source link

UBL: One unclear error signal (PEPPOL-EN16931-R044) #175

Closed SLennartsson closed 5 years ago

SLennartsson commented 5 years ago

Due to a previous remark on alternatives for ChargeIndicator – true/false and 1/0 respectively – a change was made in favour of true/false to be the only option. This may be fine, but I have one consequential observation in case the value of ChargeIndicator is mis-spelled.

Excerpt from a UBL message - example 1:

400 fals 40 440 This would generate a UBL 2.1 Invoice level error ‘The content "fals" of element does not match the required simple type. The string "fals" cannot be cast to a boolean’. This signal is correct and easy to understand. Excerpt from a UBL message - example 2: 400 0 40 440 The above would trigger rule PEPPOL-EN16931-R044 with error signal ‘Charge on price level is NOT allowed.’ In this context the signal is incomprehensible, and even more so for those who regard ‘0’ and ‘false’ to represent the same boolean value.
oriol commented 5 years ago

What is the suggestion to correct this issue then?

SLennartsson commented 5 years ago

Either test AllowanceCharge/ChargeIndicator generally: If value is other than ’true’ or ‘false’ then generate error signal “Only values from value set (’true’ or’ false’) is recognised for element ."
Or test specifically for Price/AllowanceCharge/ChargeIndicator: If value is other than ‘false’ then generate error signal “Only value ‘false’ is valid for element in this position of the message”. Or something similar.

oriol commented 5 years ago

This Rule is from PEPPOL, not from the EN 16931, should be corrected by the PEPPOL PoACC team.