<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed under European Union Public Licence (EUPL) version 1.2.

-->
<testSet xmlns="http://difi.no/xsd/vefa/validator/1.0" configuration="tc434-ubl">
	<assert>
		<description>Verify that an Invoice that contains a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is “Reverse charge” 
			shall contain the Seller VAT Identifier (BT-31), the Seller tax registration identifier (BT-32) and/or the Seller tax representative VAT identifier (BT-63) 
			and the Buyer VAT identifier (BT-48) and/or the Buyer legal registration identifier (BT-47).</description>
		<scope>BR-AE-03</scope>

	</assert>

	<test id="1">
		<assert>
			<description>BT-31 and BT-48 present</description>
			<success>BR-AE-03</success>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>NO123456789</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingSupplierParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>987654321MVA</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingCustomerParty>

			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
		</Invoice>
	</test>
	<test id="2">
		<assert>
			<description>BT-32 and BT-48 present</description>
			<success>BR-AE-03</success>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>NO123456789</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>TAX</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingSupplierParty>
			
			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>EL23424234</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingCustomerParty>
			
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
		</Invoice>
	</test>
	<test id="3">
		<assert>
			<description>BT-63 and BT-48 present</description>
			<success>BR-AE-03</success>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:TaxRepresentativeParty>
				<cac:PartyTaxScheme>
					<cbc:CompanyID>1234567</cbc:CompanyID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:PartyTaxScheme>
			</cac:TaxRepresentativeParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>987654321MVA</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingCustomerParty>

			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
		</Invoice>
	</test>
	
	<test id="4">
		<assert>
			<description>BT-31 and BT-47 present</description>
			<success>BR-AE-03</success>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>NO123456789</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingSupplierParty>
			
			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyLegalEntity>
						<cbc:CompanyID>987654321</cbc:CompanyID>
					</cac:PartyLegalEntity>
				</cac:Party>
			</cac:AccountingCustomerParty>
			
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
		</Invoice>
	</test>
	<test id="5">
		<assert>
			<description>BT-32 and BT-47 present</description>
			<success>BR-AE-03</success>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>NO123456789</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>TAX</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingSupplierParty>
			
			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyLegalEntity>
						<cbc:CompanyID>987654321</cbc:CompanyID>
					</cac:PartyLegalEntity>
				</cac:Party>
			</cac:AccountingCustomerParty>
			
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
		</Invoice>
	</test>
	<test id="6">
		<assert>
			<description>BT-63 and BT-47 present</description>
			<success>BR-AE-03</success>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:TaxRepresentativeParty>
				<cac:PartyTaxScheme>
					<cbc:CompanyID>1234567</cbc:CompanyID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:PartyTaxScheme>
			</cac:TaxRepresentativeParty>
			
			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyLegalEntity>
						<cbc:CompanyID>987654321</cbc:CompanyID>
					</cac:PartyLegalEntity>
				</cac:Party>
			</cac:AccountingCustomerParty>
			
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
		</Invoice>
	</test>
	
	

	<test id="7">
		<assert>
			<error>BR-AE-03</error>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<!-- <cbc:CompanyID>NO123456789</cbc:CompanyID>-->
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingSupplierParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>987654321MVA</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingCustomerParty>

			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>

		</Invoice>
	</test>


	<test id="8">
		<assert>
			<error>BR-AE-03</error>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<!--	<cac:PartyTaxScheme>
						 <cbc:CompanyID>NO123456789</cbc:CompanyID>
						 						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme> -->
				</cac:Party>
			</cac:AccountingSupplierParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>987654321MVA</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingCustomerParty>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>

		</Invoice>
	</test>
	<test id="9">
		<assert>
			<error>BR-AE-03</error>

		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>NO123456789</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingSupplierParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<!-- <cbc:CompanyID>987654321MVA</cbc:CompanyID>-->
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingCustomerParty>

			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>

		</Invoice>
	</test>
	<test id="10">
		<assert>
			<error>BR-AE-03</error>
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>NO123456789</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingSupplierParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<!-- <cac:PartyTaxScheme>
						<cbc:CompanyID>987654321MVA</cbc:CompanyID>
												<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme> -->
				</cac:Party>
			</cac:AccountingCustomerParty>

			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>

		</Invoice>
	</test>
	<test id="11">
		<assert>
			<error>BR-AE-03</error>

		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:TaxRepresentativeParty>
				<!--				<cac:PartyTaxScheme>
					<cbc:CompanyID>1234567</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
				</cac:PartyTaxScheme>-->
			</cac:TaxRepresentativeParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyTaxScheme>
						<cbc:CompanyID>987654321MVA</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
				</cac:Party>
			</cac:AccountingCustomerParty>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>

		</Invoice>
	</test>
	<test id="12">
		<assert>
			<error>BR-AE-03</error>

		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:TaxRepresentativeParty>
				<cac:PartyTaxScheme>
					<!--					<cbc:CompanyID>1234567</cbc:CompanyID>-->
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:PartyTaxScheme>
			</cac:TaxRepresentativeParty>

			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyLegalEntity>
						<cbc:CompanyID>987654321</cbc:CompanyID>
					</cac:PartyLegalEntity>
				</cac:Party>
			</cac:AccountingCustomerParty>
			
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>

		</Invoice>
	</test>
	<test id="13">
		<assert>
			<error>BR-AE-03</error>
			
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:TaxRepresentativeParty>
				<cac:PartyTaxScheme>
					<cbc:CompanyID>1234567</cbc:CompanyID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:PartyTaxScheme>
			</cac:TaxRepresentativeParty>
			
			<cac:AccountingCustomerParty>
				<cac:Party>
					<cac:PartyLegalEntity>
<!--						<cbc:CompanyID>987654321</cbc:CompanyID>-->
					</cac:PartyLegalEntity>
				</cac:Party>
			</cac:AccountingCustomerParty>
			
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
			
		</Invoice>
	</test>
	<test id="14">
		<assert>
			<error>BR-AE-03</error>
			
		</assert>
		<Invoice
			xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
			xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
			xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
			<cac:TaxRepresentativeParty>
				<cac:PartyTaxScheme>
					<cbc:CompanyID>1234567</cbc:CompanyID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:PartyTaxScheme>
			</cac:TaxRepresentativeParty>
			
			<cac:AccountingCustomerParty>
				<cac:Party>
<!--					<cac:PartyLegalEntity>
						<cbc:CompanyID>987654321</cbc:CompanyID>
					</cac:PartyLegalEntity>-->
				</cac:Party>
			</cac:AccountingCustomerParty>
			
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cac:TaxCategory>
					<cbc:ID>AE</cbc:ID>
					<cac:TaxScheme>
						<cbc:ID>VAT</cbc:ID>
					</cac:TaxScheme>
				</cac:TaxCategory>
			</cac:AllowanceCharge>
			
		</Invoice>
	</test>
</testSet>
