NFE-1064

Rejeição: Valor da Alíquota Efetiva da CBS calculado incorretamente [nItem: …] (pAliqEfet …).

In English The effective CBS rate (gCBS/gRed/pAliqEfet) is not pCBS × (1 - pRedAliq/100), times (1 - pRedutor/100) in a government purchase, rounded to four decimals.

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($cbs/nfe:gRed) or abs(br:dec($cbs/nfe:gRed/nfe:pAliqEfet) - round(br:dec($cbs/nfe:pCBS) * (1 - br:dec($cbs/nfe:gRed/nfe:pRedAliq) div 100) * $reducer, 4)) le 0.0001

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