Attestwire › Rule reference › ATW-VAT-SCENARIO-CONFLICT

ATW-VAT-SCENARIO-CONFLICT A line must not state both a vatScenario and a different VAT category of its own

noun · Attestwire · fatal · BT-151

For a sample invoice, the library reports: Line 1 states vatScenario "domestic", which stands for VAT category S (Standard rated), and also vatCategory "Z". The scenario says what happened and the category is its code, so one of the two is wrong.

Business term
BT-151
Severity
fatal

The fix

Remove one of the two from lines[0]: drop vatCategory to let the scenario decide the code, or drop vatScenario if "Z" is what you meant.

A passing value

the shape this field expects
"vatScenario": "domestic"

What the library returns

The full error returned by @attestwire/en16931. It includes the rule ID, affected field and suggested correction. Developers can use this object in their application:

TeachingError
{
  "rule": "ATW-VAT-SCENARIO-CONFLICT",
  "field": "BT-151",
  "severity": "fatal",
  "message": "Line 1 states vatScenario \"domestic\", which stands for VAT category S (Standard rated), and also vatCategory \"Z\". The scenario says what happened and the category is its code, so one of the two is wrong. An explicit category wins over a scenario, so the document would say \"Z\" and nothing from the scenario would be written.",
  "fix": "Remove one of the two from lines[0]: drop vatCategory to let the scenario decide the code, or drop vatScenario if \"Z\" is what you meant.",
  "example": "\"vatScenario\": \"domestic\"",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:Item/cac:ClassifiedTaxCategory/cbc:ID",
  "docsUrl": "https://github.com/attestwire/en16931#not-implemented-yet"
}

xpath is always a UBL path. On a CII invoice, look for the matching CII field instead.