BR-RO-030

Daca Codul monedei facturii (BT-5) este altul decat RON, atunci Codul monedei de contabilizare a TVA (BT-6) trebuie sa fie RON. #If the Invoice currency code (BT-5) is other than RON, then the VAT accounting currency code(BT-6) must be RON.

error: the document is invalid

Why it fails

  • The invoice is in another currency (cbc:DocumentCurrencyCode EUR, for example) and cbc:TaxCurrencyCode is missing or is not RON.

How to fix it

Add <cbc:TaxCurrencyCode>RON</cbc:TaxCurrencyCode> after the document currency, and a second cac:TaxTotal with the VAT total in RON (BT-111).

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.

Context
/ubl:Invoice | /cn:CreditNote
Test
(normalize-space(cbc:TaxCurrencyCode) = 'RON' and normalize-space(cbc:DocumentCurrencyCode) != 'RON') or (normalize-space(cbc:TaxCurrencyCode) = 'RON' and normalize-space(cbc:DocumentCurrencyCode) = 'RON') or (normalize-space(cbc:TaxCurrencyCode) != 'RON' and normalize-space(cbc:DocumentCurrencyCode) = 'RON') or (not(exists (cbc:TaxCurrencyCode)) and normalize-space(cbc:DocumentCurrencyCode) = 'RON')

Checked with Romania RO e-Factura Invoice (UBL), Romania RO e-Factura Credit Note (UBL)