ConnectingEurope / eInvoicing-EN16931

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

UBL-SR-46: mapping of BT-82 to credit transfer (that may repeat) #197

Closed SLennartsson closed 4 years ago

SLennartsson commented 4 years ago

The EN specifies cardinality 0..1 for BT-82 Payment means text. When BT-82 is present in a “credit transfer”-invoice, the understanding must be that BT-82 applies to all instances of BG-17 accounts (in case there are more than one).

The UBL mapping has a different structure in that the whole class of PaymentMeans is repeated in case of more than one credit transfer account. As a consequence, presence of BT-82 must mean that PaymentMeansCode/@name is to be included in each and every instance of class PaymentMeans, and with @name being constant across all these instances.

Currently, UBL-SR-46 incorrectly triggers if more than one PaymentMeansCode/@name is encountered in an invoice (that is, even though the values of @name are kept identical). Based on the principle for BT-82 in the EN one would expect a validation error if one of the credit transfers includes @name while another instance does not, but no such error is signalled.

Invoice_When_BT-82_repeats_in_UBL.txt

oriol commented 4 years ago

I would suggest keeping the rule as it is. The BT-82 cardinality is 0..1 and that's what the rule checks. In case the PaymentMeans has to be repeated for Credit Transfers, only one should contain the @name with information about BT-82.