# NFE-1041

Source: https://xmlvalid.com/rules/NFE-1041

> Rejeição: Valor do IBS da UF difere do calculado [nItem: …] (vIBSUF …, calculado …).

- Level: error
- Rule sets: SEFAZ authorisation rules of NF-e 4.00 MOC 7.0 Anexo I, NTs up to 2026.010
- Context: `nfe:infNFe/nfe:det/nfe:imposto/nfe:IBSCBS/nfe:gIBSCBS`
- Test: `not($uf) or abs(br:dec($uf/nfe:vIBSUF) - (round($vBC * $rUF div 100, 2) - br:dec($uf/nfe:gDif/nfe:vDif) - br:dec($uf/nfe:gDevTrib/nfe:vDevTrib))) le 0.01`

In English: vIBSUF is not vBC × the state IBS rate (or pAliqEfet) minus the deferred and refunded amounts (R$ 0.01 tolerance).

## Why it fails

- The 2026 test rate is 0.1% for the state IBS: 0.10 in pIBSUF, a percentage, not 0.001.
- vBC of the IBS and CBS still includes ICMS, PIS and COFINS, or the other way round, while vIBSUF was computed from another base.

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