PEPPOL-EN16931-R054
The rule sets below word this rule differently; each wording is shown with its rule set.
Why it fails
- The invoice has a VAT accounting currency (
cbc:TaxCurrencyCode) but no secondcac:TaxTotalwith the VAT in that currency, or it has such a total without the currency code.
How to fix it
With a tax currency code, add a second cac:TaxTotal holding only cbc:TaxAmount in that currency, without subtotals. Without one, leave the second tax total out.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
Only one tax total without tax subtotals MUST be provided when tax currency code is provided.
ubl-creditnote:CreditNote | ubl-invoice:Invoice
count(cac:TaxTotal[not(cac:TaxSubtotal)]) = (if (cbc:TaxCurrencyCode) then 1 else 0)
Checked with Peppol BIS Billing 3.0 Invoice, Peppol BIS Billing 3.0 Credit Note
Only one tax total amount must be provided where currency id equals tax currency code, if tax currency code (BT-6) is provided.
ram:ApplicableHeaderTradeSettlement
count(ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID != $documentCurrencyCode]) = (if (ram:TaxCurrencyCode) then 1 else 0)
Checked with XRechnung 3.0 Invoice (CII)