# BR-RO-030

Source: https://xmlvalid.com/rules/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.

- Level: error
- Rule sets: Romanian RO e-Factura rules (UBL) 1.0.9
- 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')`

## 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).

Validate a document against these rules: https://xmlvalid.com/validate
