XML invoice numbers calculations

i get these warnings when i submit my xml
“warningMessages”: [
{
“type”: “WARNING”,
“code”: “BR-S-08”,
“category”: “EN_16931”,
“message”: “[BR-S-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is ’ Standard rated’ the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are ‘Standard Rate’.”,
“status”: “WARNING”
},
{
“type”: “WARNING”,
“code”: “BR-CO-10”,
“category”: “EN_16931”,
“message”: "Sum of Invoice line net amount (BT-106) ",
“status”: “WARNING”
},
{
“type”: “WARNING”,
“code”: “BR-CO-13”,
“category”: “EN_16931”,
“message”: “Invoice total amount without VAT (BT-109) = S Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107)”,
“status”: “WARNING”
},
{
“type”: “WARNING”,
“code”: “BR-KSA-EN16931-11”,
“category”: “KSA”,
“message”: “Invoice line net amount (BT-131) must equal (Invoiced quantity (BT-129) * (Item net price (BT-146) / item price base quantity (BT-149))) + Sum of invoice line charge amount (BT-141) - Sum of invoice line allowance amount (BT-136)”,
“status”: “WARNING”
}

this is my xml

<cac:AllowanceCharge>
	<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
	<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
	<cbc:Amount currencyID="SAR">200.00</cbc:Amount>
	<cac:TaxCategory>
		<cbc:ID>S</cbc:ID>
		<cbc:Percent>15</cbc:Percent>
		<cac:TaxScheme>
			<cbc:ID>VAT</cbc:ID>
		</cac:TaxScheme>
	</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:TaxTotal>
	<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
</cac:TaxTotal>
<cac:TaxTotal>
	<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
	<cac:TaxSubtotal>
		<cbc:TaxableAmount currencyID="SAR">9800.00</cbc:TaxableAmount>
		<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
		<cac:TaxCategory>
			<cbc:ID>S</cbc:ID>
			<cbc:Percent>15.00</cbc:Percent>
			<cac:TaxScheme>
				<cbc:ID>VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:TaxCategory>
	</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
	<cbc:LineExtensionAmount currencyID="SAR">10000.00</cbc:LineExtensionAmount>
	<cbc:TaxExclusiveAmount currencyID="SAR">9800.00</cbc:TaxExclusiveAmount>
	<cbc:TaxInclusiveAmount currencyID="SAR">11270.00</cbc:TaxInclusiveAmount>
	<cbc:AllowanceTotalAmount currencyID="SAR">200.00</cbc:AllowanceTotalAmount>
	<cbc:PayableAmount currencyID="SAR">11270.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
	<cbc:ID>1</cbc:ID>
	<cbc:InvoicedQuantity unitCode="PCE">500.00</cbc:InvoicedQuantity>
	<cbc:LineExtensionAmount currencyID="SAR">9800.00</cbc:LineExtensionAmount>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
		<cbc:RoundingAmount currencyID="SAR">11270.00</cbc:RoundingAmount>
	</cac:TaxTotal>
	<cac:Item>
		<cbc:Name>OT H250/E40 1/12 (93104679) TU MIC DS</cbc:Name>
		<cac:ClassifiedTaxCategory>
			<cbc:ID>S</cbc:ID>
			<cbc:Percent>15.00</cbc:Percent>
			<cac:TaxScheme>
				<cbc:ID>VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:ClassifiedTaxCategory>
	</cac:Item>
	<cac:Price>
		<cbc:PriceAmount currencyID="SAR">20.00</cbc:PriceAmount>
		<cac:AllowanceCharge>
			<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
			<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
			<cbc:Amount currencyID="SAR">200.00</cbc:Amount>
		</cac:AllowanceCharge>
	</cac:Price>
</cac:InvoiceLine>

If 200 SAR is line level Discount then

<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
	</cac:TaxTotal>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">9800.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID>S</cbc:ID>
				<cbc:Percent>15.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:LegalMonetaryTotal>
		<cbc:LineExtensionAmount currencyID="SAR">9800.00</cbc:LineExtensionAmount>
		<cbc:TaxExclusiveAmount currencyID="SAR">9800.00</cbc:TaxExclusiveAmount>
		<cbc:TaxInclusiveAmount currencyID="SAR">11270.00</cbc:TaxInclusiveAmount>
		<cbc:AllowanceTotalAmount currencyID="SAR">0.00</cbc:AllowanceTotalAmount>
		<cbc:PayableAmount currencyID="SAR">11270.00</cbc:PayableAmount>
	</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">500.00</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">9800.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">1470.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">11270.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>OT H250/E40 1/12 (93104679) TU MIC DS</cbc:Name>
			<cac:ClassifiedTaxCategory>
				<cbc:ID>S</cbc:ID>
				<cbc:Percent>15.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:ClassifiedTaxCategory>
		</cac:Item>
		<cac:Price>
			<cbc:PriceAmount currencyID="SAR">19.6</cbc:PriceAmount>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">0.40</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>

Ok i got the point.
You reduce the discount from the unit price.
Thnx for your response.

Dear @abdalla

Thanks for reaching out,

For BR-KSA-EN16931>> You have one inviceLine with LineExtensionAmount=9800.00 which mean it’s a wrong calculation since the InvoicedQuantity=500 and PriceAmount=20 this mean the LineExtensionAmount should be =10000.00

after this you need to update the TaxAmount to be =1500.00

And also for all the below warnings, you need to update the cbc:TaxAmount inside the cac:TaxTotal ,and also the cbc:TaxableAmount inside cac:TaxSubtotal

Please find attached file (UpdateCalculations) after fixing the calculation for your XML.
UpdateCalculations.pdf (2.2 KB)

Please do not hesitate to reach out for any further clarification.

Thanks,
Ibrahem Daoud.

1 Like