NFE-1142

Rejeição: Soma dos valores de IBS e CBS em compras governamentais divergente [nItem: …].

In English The IBS and CBS of gTribCompraGov differ from vIBSUF + vIBSMun + vCBS by more than R$ 0.04.

error: the document is invalid

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
nfe:infNFe/nfe:det/nfe:imposto/nfe:IBSCBS/nfe:gIBSCBS
Test
not($purchase) or abs(br:dec($purchase/nfe:vTribIBSUF) + br:dec($purchase/nfe:vTribIBSMun) + br:dec($purchase/nfe:vTribCBS) - (br:dec($uf/nfe:vIBSUF) + br:dec($mun/nfe:vIBSMun) + br:dec($cbs/nfe:vCBS))) le 0.04

Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol