Include the country in the delivery address

Error BR-57 EN 16931

Each Deliver to address (BG-15) shall contain a Deliver to country code (BT-80).

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

A ram:PostalTradeAddress for ram:ShipToTradeParty is present, but ram:CountryID is missing or empty.

What the rule means

BT-80 specifies the country of the delivery address. The country code is required for the delivery address to be complete.

Affected fields BG-15 BT-80
Please add the country code to the delivery address

The delivery address does not contain a country code. Add this information to complete the address.

What to do
  1. Check the delivery address under ShipToTradeParty.
  2. Set the value for ram:CountryID using Party.Country.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:ShipToTradeParty>
  <ram:PostalTradeAddress/>
</ram:ShipToTradeParty>
✓ Correct
<ram:ShipToTradeParty>
  <ram:PostalTradeAddress>
    <ram:CountryID>DE</ram:CountryID>
  </ram:PostalTradeAddress>
</ram:ShipToTradeParty>
Check in FactoorSharp
  • Party.Country (ShipToTradeParty: BT-80)
Technical details

The test passes if there is no ram:PostalTradeAddress for ram:ShipToTradeParty, or if its ram:CountryID is not empty.

Where the rule applies

Applies to the delivery address ram:PostalTradeAddress of ram:ShipToTradeParty.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery
Test expression (assert/@test)
( ram:ShipToTradeParty/ram:PostalTradeAddress and ram:ShipToTradeParty/ram:PostalTradeAddress/ram:CountryID!='' ) or not (ram:ShipToTradeParty/ram:PostalTradeAddress)