Limit decimals in the VAT total in accounting currency

Error BR-DEC-15 EN 16931

The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

When TaxCurrencyCode is specified and TaxTotalAmount is stated in that currency, the amount has more than two decimal places.

What the rule means

The VAT total in accounting currency may have no more than two decimal places.

Affected fields BT-111
Please limit the decimal places in the VAT total in accounting currency

TaxTotalAmount in accounting currency has more than two decimal places. If TaxCurrencyCode is specified, the amount's currency must match it and the amount may have no more than two decimal places.

What to do
  1. Check the value of TaxTotalAmount in accounting currency and the specified TaxCurrencyCode.
  2. Match the currency of TaxTotalAmount to TaxCurrencyCode and limit the amount to no more than two decimal places.
  3. Check TaxTotalAmountInAccountingCurrency and the calls to SetTaxTotalInAccountingCurrency(...) or SetTaxCurrencyExchange(...).
  4. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<rsm:CrossIndustryInvoice>
  <rsm:SupplyChainTradeTransaction>
    <ram:ApplicableHeaderTradeSettlement>
      <ram:TaxCurrencyCode>USD</ram:TaxCurrencyCode>
      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
        <ram:TaxTotalAmount currencyID="USD">12.345</ram:TaxTotalAmount>
      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    </ram:ApplicableHeaderTradeSettlement>
  </rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
✓ Correct
<rsm:CrossIndustryInvoice>
  <rsm:SupplyChainTradeTransaction>
    <ram:ApplicableHeaderTradeSettlement>
      <ram:TaxCurrencyCode>USD</ram:TaxCurrencyCode>
      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
        <ram:TaxTotalAmount currencyID="USD">12.34</ram:TaxTotalAmount>
      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    </ram:ApplicableHeaderTradeSettlement>
  </rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
Check in FactoorSharp
  • FacturXInvoice.TaxTotalAmountInAccountingCurrency (BT-111)
  • FacturXInvoice.SetTaxTotalInAccountingCurrency(taxTotalInAccountingCurrency, accountingCurrency) (BT-111)
  • FacturXInvoice.SetTaxCurrencyExchange(taxTotalInAccountingCurrency, accountingCurrency, conversionRate, conversionRateTimestamp) (taxTotalInAccountingCurrency: BT-111)
Technical details

The XPath allows a missing TaxTotalAmount or a missing TaxCurrencyCode. If TaxCurrencyCode is present, the currencyID of TaxTotalAmount must match it and the amount must be rounded to two decimal places.

Where the rule applies

The rule applies to TaxTotalAmount in SpecifiedTradeSettlementHeaderMonetarySummation. It checks the amount against TaxCurrencyCode when the accounting currency is specified.

Context (rule/@context)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
not(ram:TaxTotalAmount) or ram:TaxTotalAmount[ ( @currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode and . = round(. * 100) div 100 ) or not (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:TaxCurrencyCode) ]