VAT amounts must have matching signs

Error PEPPOL-EN16931-R055 Peppol

Invoice total VAT amount and Invoice total VAT amount in accounting currency MUST have the same operational sign

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

The VAT amount in the VAT accounting currency and the VAT amount in the document currency have different signs: one is negative while the other is zero or positive, or vice versa.

What the rule means

The rule keeps the direction of the VAT amounts consistent in both currencies. An amount below zero must be below zero in both currencies; an amount of zero or more must be zero or more in both.

Please use the same sign for both VAT amounts

The VAT amount in the VAT accounting currency has a different sign from the amount in the document currency. Make the signs of the two amounts consistent.

What to do
  1. Locate the two ram:TaxTotalAmount elements in ram:SpecifiedTradeSettlementHeaderMonetarySummation.
  2. Compare the amount in the invoice currency with the amount in the currency specified by ram:TaxCurrencyCode.
  3. Make sure both amounts are either negative or zero and positive.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:ApplicableHeaderTradeSettlement>
  <ram:TaxCurrencyCode>USD</ram:TaxCurrencyCode>
  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    <ram:TaxTotalAmount currencyID="EUR">-10.00</ram:TaxTotalAmount>
    <ram:TaxTotalAmount currencyID="USD">11.00</ram:TaxTotalAmount>
  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
✓ Correct
<ram:ApplicableHeaderTradeSettlement>
  <ram:TaxCurrencyCode>USD</ram:TaxCurrencyCode>
  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    <ram:TaxTotalAmount currencyID="EUR">-10.00</ram:TaxTotalAmount>
    <ram:TaxTotalAmount currencyID="USD">-11.00</ram:TaxTotalAmount>
  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
Technical details

The test does not apply if ram:TaxCurrencyCode or a ram:TaxTotalAmount in the document currency is absent. Otherwise, both amounts must be either less than zero or greater than or equal to zero.

Where the rule applies

The rule applies to VAT amounts in ram:SpecifiedTradeSettlementHeaderMonetarySummation within ram:ApplicableHeaderTradeSettlement when ram:TaxCurrencyCode and an amount in the document currency are present.

Context (rule/@context)
ram:ApplicableHeaderTradeSettlement
Test expression (assert/@test)
not( /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:TaxCurrencyCode and ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $documentCurrencyCode] ) or ( ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $taxCurrencyCode] < 0 and ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $documentCurrencyCode] < 0 ) or ( ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $taxCurrencyCode] >= 0 and ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $documentCurrencyCode] >= 0 )