List of warnings with discount

Dear All,
I hope this message finds you well,

We sent simplified invoice with a discount value and accepted it, but these warnings came from Zatca response (note these warnings come with non-Saudi patients):
{“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD_ZATCA_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“type”:“WARNING”,“code”:“BR-CO-17”,“category”:“EN_16931”,“message”:“VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.”,“status”:“WARNING”},
{“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-S-09”,“category”:“EN_16931”,“message”:“The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Standard rated" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119).”,“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”}],
“errorMessages”:,“status”:“WARNING”},“reportingStatus”:“REPORTED”}

And Saudi patients come with different warnings :
{“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD_ZATCA_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“type”:“WARNING”,“code”:“BR-Z-08”,“category”:“EN_16931”,“message”:“[BR-Z-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is ’ Zero 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 ‘Zero Rated’.”,“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”}],
“errorMessages”:,“status”:“WARNING”},“reportingStatus”:“REPORTED”}

The XML invoice for Saudi patients:

<cac:AccountingSupplierParty>
		<cac:Party>
		    <cac:PartyIdentification>
			    <cbc:ID schemeID="CRN">1041776384</cbc:ID>
		    </cac:PartyIdentification>
			<cac:PostalAddress>
				<cbc:StreetName>Imam Saud Bin Abdulaziz Bin Mohammed Rd</cbc:StreetName>
				<cbc:BuildingNumber>2365</cbc:BuildingNumber>
				<cbc:CitySubdivisionName>King Fahad Dist.</cbc:CitySubdivisionName>
				<cbc:CityName>Riyadh</cbc:CityName>
				<cbc:PostalZone>12273</cbc:PostalZone>
				<cbc:CountrySubentity>Kingdom Of Saudi Arabia</cbc:CountrySubentity>
				<cac:Country>
					<cbc:IdentificationCode>SA</cbc:IdentificationCode>
				</cac:Country>
			</cac:PostalAddress>
			<cac:PartyTaxScheme>
				<cbc:CompanyID>310179890800003</cbc:CompanyID>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>Children With Disability Association</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingSupplierParty>
	<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="NAT">1077540332</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>جمان حمد</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
 
	
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>48</cbc:PaymentMeansCode>
		<cbc:InstructionNote />
	</cac:PaymentMeans>
	<cac:AllowanceCharge>
	<cbc:ID>1</cbc:ID>
	<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
    
	<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
	<cbc:Amount currencyID="SAR">40.00</cbc:Amount>
	<cac:TaxCategory>
		<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">Z</cbc:ID>
		<cbc:Percent>0.00</cbc:Percent>
		<cac:TaxScheme>
			<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
		</cac:TaxScheme>
	</cac:TaxCategory>
</cac:AllowanceCharge>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
	</cac:TaxTotal>
<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">160.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
                <cbc:TaxExemptionReasonCode>VATEX-SA-HEA</cbc:TaxExemptionReasonCode><cbc:TaxExemptionReason>Saudi Child</cbc:TaxExemptionReason>
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
        	</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	
	<cac:LegalMonetaryTotal>
	<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
	<cbc:TaxExclusiveAmount currencyID="SAR">160.00</cbc:TaxExclusiveAmount>
	<cbc:TaxInclusiveAmount currencyID="SAR">160.00</cbc:TaxInclusiveAmount>
	<cbc:AllowanceTotalAmount currencyID="SAR">40.00</cbc:AllowanceTotalAmount>
	<cbc:ChargeTotalAmount currencyID="SAR">0.00</cbc:ChargeTotalAmount>
    <cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount> 
	<cbc:PayableAmount currencyID="SAR">160.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">160.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>عيادة أطفال</cbc:Name>
			<cac:ClassifiedTaxCategory>
				<cbc:ID>Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:ClassifiedTaxCategory>
		</cac:Item>
		<cac:Price>
			<cbc:PriceAmount currencyID="SAR">200.00</cbc:PriceAmount>
            <cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">40.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>

The XML invoice for Non-Saudi patients:

  <cac:AccountingSupplierParty>
		<cac:Party>
		    <cac:PartyIdentification>
			    <cbc:ID schemeID="CRN">1041776384</cbc:ID>
		    </cac:PartyIdentification>
			<cac:PostalAddress>
				<cbc:StreetName>Imam Saud Bin Abdulaziz Bin Mohammed Rd</cbc:StreetName>
				<cbc:BuildingNumber>2365</cbc:BuildingNumber>
				<cbc:CitySubdivisionName>King Fahad Dist.</cbc:CitySubdivisionName>
				<cbc:CityName>Riyadh</cbc:CityName>
				<cbc:PostalZone>12273</cbc:PostalZone>
				<cbc:CountrySubentity>Kingdom Of Saudi Arabia</cbc:CountrySubentity>
				<cac:Country>
					<cbc:IdentificationCode>SA</cbc:IdentificationCode>
				</cac:Country>
			</cac:PostalAddress>
			<cac:PartyTaxScheme>
				<cbc:CompanyID>310179890800003</cbc:CompanyID>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>Children With Disability Association</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingSupplierParty>
	<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="IQA">0234841514</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>أحمد أيمن</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
 
	
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>48</cbc:PaymentMeansCode>
		<cbc:InstructionNote />
	</cac:PaymentMeans>
	<cac:AllowanceCharge>
	<cbc:ID>1</cbc:ID>
	<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
    
	<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
	<cbc:Amount currencyID="SAR">40.00</cbc:Amount>
	<cac:TaxCategory>
		<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
		<cbc:Percent>15.00</cbc:Percent>
		<cac:TaxScheme>
			<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
		</cac:TaxScheme>
	</cac:TaxCategory>
</cac:AllowanceCharge>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">18.00</cbc:TaxAmount>
	</cac:TaxTotal>
<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">18.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">160.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">18.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
				<cbc:Percent>15.00</cbc:Percent>
                
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
        	</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	
	<cac:LegalMonetaryTotal>
	<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
	<cbc:TaxExclusiveAmount currencyID="SAR">160.00</cbc:TaxExclusiveAmount>
	<cbc:TaxInclusiveAmount currencyID="SAR">178.00</cbc:TaxInclusiveAmount>
	<cbc:AllowanceTotalAmount currencyID="SAR">40.00</cbc:AllowanceTotalAmount>
	<cbc:ChargeTotalAmount currencyID="SAR">0.00</cbc:ChargeTotalAmount>
    <cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount> 
	<cbc:PayableAmount currencyID="SAR">178.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">24.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">184.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>عيادة أطفال</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">200.00</cbc:PriceAmount>
            <cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">40.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>

We are sure all mathematical processes are correct.
Please, can you explain why these warnings appear??

I appreciate your help.

Check it, I made some changes to your xml

<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
	<cbc:ProfileID>reporting:1.0</cbc:ProfileID>
	<cbc:ID>SME00010</cbc:ID>
	<cbc:UUID>8e6000cf-1a98-4174-b3e7-b5d5954bc10d</cbc:UUID>
	<cbc:IssueDate>2022-08-17</cbc:IssueDate>
	<cbc:IssueTime>17:41:08</cbc:IssueTime>
	<cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>
	<cbc:Note languageID="ar">ABC</cbc:Note>
	<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
	<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
	<cac:AdditionalDocumentReference>
		<cbc:ID>ICV</cbc:ID>
		<cbc:UUID>10</cbc:UUID>
	</cac:AdditionalDocumentReference>
	<cac:AdditionalDocumentReference>
		<cbc:ID>PIH</cbc:ID>
		<cac:Attachment>
			<cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==</cbc:EmbeddedDocumentBinaryObject>
		</cac:Attachment>
	</cac:AdditionalDocumentReference>
	<cac:AccountingSupplierParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="CRN">1041776384</cbc:ID>
			</cac:PartyIdentification>
			<cac:PostalAddress>
				<cbc:StreetName>Imam Saud Bin Abdulaziz Bin Mohammed Rd</cbc:StreetName>
				<cbc:BuildingNumber>2365</cbc:BuildingNumber>
				<cbc:CitySubdivisionName>King Fahad Dist.</cbc:CitySubdivisionName>
				<cbc:CityName>Riyadh</cbc:CityName>
				<cbc:PostalZone>12273</cbc:PostalZone>
				<cbc:CountrySubentity>Kingdom Of Saudi Arabia</cbc:CountrySubentity>
				<cac:Country>
					<cbc:IdentificationCode>SA</cbc:IdentificationCode>
				</cac:Country>
			</cac:PostalAddress>
			<cac:PartyTaxScheme>
				<cbc:CompanyID>310179890800003</cbc:CompanyID>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>Children With Disability Association</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingSupplierParty>
	<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="NAT">1077540332</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>جمان حمد</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>48</cbc:PaymentMeansCode>
	</cac:PaymentMeans>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
	</cac:TaxTotal>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">160.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
				<cbc:TaxExemptionReasonCode>VATEX-SA-HEA</cbc:TaxExemptionReasonCode>
				<cbc:TaxExemptionReason>Saudi Child</cbc:TaxExemptionReason>
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:LegalMonetaryTotal>
		<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
		<cbc:TaxExclusiveAmount currencyID="SAR">160.00</cbc:TaxExclusiveAmount>
		<cbc:TaxInclusiveAmount currencyID="SAR">160.00</cbc:TaxInclusiveAmount>
		<cbc:ChargeTotalAmount currencyID="SAR">0.00</cbc:ChargeTotalAmount>
		<cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
		<cbc:PayableAmount currencyID="SAR">160.00</cbc:PayableAmount>
	</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">160.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>عيادة أطفال</cbc:Name>
			<cac:ClassifiedTaxCategory>
				<cbc:ID>Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:ClassifiedTaxCategory>
		</cac:Item>
		<cac:Price>
			<cbc:PriceAmount currencyID="SAR">160.00</cbc:PriceAmount>
			<cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">40.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>
</Invoice>

==

<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
	<cbc:ProfileID>reporting:1.0</cbc:ProfileID>
	<cbc:ID>SME00010</cbc:ID>
	<cbc:UUID>8e6000cf-1a98-4174-b3e7-b5d5954bc10d</cbc:UUID>
	<cbc:IssueDate>2022-08-17</cbc:IssueDate>
	<cbc:IssueTime>17:41:08</cbc:IssueTime>
	<cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>
	<cbc:Note languageID="ar">ABC</cbc:Note>
	<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
	<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
	<cac:AdditionalDocumentReference>
		<cbc:ID>ICV</cbc:ID>
		<cbc:UUID>10</cbc:UUID>
	</cac:AdditionalDocumentReference>
	<cac:AdditionalDocumentReference>
		<cbc:ID>PIH</cbc:ID>
		<cac:Attachment>
			<cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==</cbc:EmbeddedDocumentBinaryObject>
		</cac:Attachment>
	</cac:AdditionalDocumentReference>
	<cac:AccountingSupplierParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="CRN">1041776384</cbc:ID>
			</cac:PartyIdentification>
			<cac:PostalAddress>
				<cbc:StreetName>Imam Saud Bin Abdulaziz Bin Mohammed Rd</cbc:StreetName>
				<cbc:BuildingNumber>2365</cbc:BuildingNumber>
				<cbc:CitySubdivisionName>King Fahad Dist.</cbc:CitySubdivisionName>
				<cbc:CityName>Riyadh</cbc:CityName>
				<cbc:PostalZone>12273</cbc:PostalZone>
				<cbc:CountrySubentity>Kingdom Of Saudi Arabia</cbc:CountrySubentity>
				<cac:Country>
					<cbc:IdentificationCode>SA</cbc:IdentificationCode>
				</cac:Country>
			</cac:PostalAddress>
			<cac:PartyTaxScheme>
				<cbc:CompanyID>310179890800003</cbc:CompanyID>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:PartyTaxScheme>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>Children With Disability Association</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingSupplierParty>
	<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="IQA">0234841514</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>أحمد أيمن</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>48</cbc:PaymentMeansCode>
	</cac:PaymentMeans>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">24.00</cbc:TaxAmount>
	</cac:TaxTotal>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">24.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">160.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">24.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
				<cbc:Percent>15.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:LegalMonetaryTotal>
		<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
		<cbc:TaxExclusiveAmount currencyID="SAR">160.00</cbc:TaxExclusiveAmount>
		<cbc:TaxInclusiveAmount currencyID="SAR">184.00</cbc:TaxInclusiveAmount>
		<cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
		<cbc:PayableAmount currencyID="SAR">184.00</cbc:PayableAmount>
	</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">160.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">24.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">184.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>عيادة أطفال</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">160.00</cbc:PriceAmount>
			<cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">40.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>
</Invoice>

Thank you for your help and quick response.

The warnings were fixed, but when we tested another case, a new warning appeared, if the quantity was greater than one, this warning comes with Saudi and non-Saudi patients, the warning message:

{“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD_ZATCA_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“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”}],“errorMessages”:,“status”:“WARNING”},“reportingStatus”:“REPORTED”}

And XML invoice:

<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="NAT">1077540332</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>جمان حمد</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
 
	
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>48</cbc:PaymentMeansCode>
		<cbc:InstructionNote />
	</cac:PaymentMeans>

	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
	</cac:TaxTotal>
<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">4500.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
                <cbc:TaxExemptionReasonCode>VATEX-SA-HEA</cbc:TaxExemptionReasonCode><cbc:TaxExemptionReason>Saudi Child</cbc:TaxExemptionReason>
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
        	</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	
	<cac:LegalMonetaryTotal>
	<cbc:LineExtensionAmount currencyID="SAR">4500.00</cbc:LineExtensionAmount>
	<cbc:TaxExclusiveAmount currencyID="SAR">4500.00</cbc:TaxExclusiveAmount>
	<cbc:TaxInclusiveAmount currencyID="SAR">4500.00</cbc:TaxInclusiveAmount>
     <cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount> 
	<cbc:PayableAmount currencyID="SAR">4500.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">3</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">4500.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">4500.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>two service for 3 times weekly for 4 weeks</cbc:Name>
			<cac:ClassifiedTaxCategory>
				<cbc:ID>Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:ClassifiedTaxCategory>
		</cac:Item>
		<cac:Price>
			<cbc:PriceAmount currencyID="SAR">4500.00</cbc:PriceAmount>
            <cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>

Thank you…

Check it

3 x 4.500 = 13.500  not  4.500
<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="NAT">1077540332</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>جمان حمد</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>48</cbc:PaymentMeansCode>
		<cbc:InstructionNote/>
	</cac:PaymentMeans>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
	</cac:TaxTotal>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">13500.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
				<cbc:TaxExemptionReasonCode>VATEX-SA-HEA</cbc:TaxExemptionReasonCode>
				<cbc:TaxExemptionReason>Saudi Child</cbc:TaxExemptionReason>
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:LegalMonetaryTotal>
		<cbc:LineExtensionAmount currencyID="SAR">13500.00</cbc:LineExtensionAmount>
		<cbc:TaxExclusiveAmount currencyID="SAR">13500.00</cbc:TaxExclusiveAmount>
		<cbc:TaxInclusiveAmount currencyID="SAR">13500.00</cbc:TaxInclusiveAmount>
		<cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
		<cbc:PayableAmount currencyID="SAR">13500.00</cbc:PayableAmount>
	</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">3</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">13500.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">13500.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>two service for 3 times weekly for 4 weeks</cbc:Name>
			<cac:ClassifiedTaxCategory>
				<cbc:ID>Z</cbc:ID>
				<cbc:Percent>0.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:ClassifiedTaxCategory>
		</cac:Item>
		<cac:Price>
			<cbc:PriceAmount currencyID="SAR">4500.00</cbc:PriceAmount>
			<cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>

Thank you for your quick response,

We fixed the multiplication process but the result was rejected if vat is not zero, these is the list of warnings and errors (whether the invoice has a discount or not):

{“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD_ZATCA_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“type”:“WARNING”,“code”:“BR-CO-17”,“category”:“EN_16931”,“message”:“VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.”,“status”:“WARNING”},{“type”:“WARNING”,“code”:“BR-S-09”,“category”:“EN_16931”,“message”:“The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Standard rated" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119).”,“status”:“WARNING”},{“type”:“WARNING”,“code”:“BR-KSA-51”,“category”:“KSA”,“message”:“The line amount with VAT (KSA-12) must be Invoice line net amount (BT-131) + Line VAT amount (KSA-11).”,“status”:“WARNING”}],“errorMessages”:[{“type”:“ERROR”,“code”:“BR-CO-15”,“category”:“EN_16931”,“message”:"Invoice total amount with VAT (BT-112) ",“status”:“ERROR”}],“status”:“ERROR”},“reportingStatus”:“NOT_REPORTED”}

XML invoice:

	<cac:AccountingCustomerParty>
		<cac:Party>
			<cac:PartyIdentification>
				<cbc:ID schemeID="IQA">0234841514</cbc:ID>
			</cac:PartyIdentification>
			<cac:PartyLegalEntity>
				<cbc:RegistrationName>أحمد أيمن</cbc:RegistrationName>
			</cac:PartyLegalEntity>
		</cac:Party>
	</cac:AccountingCustomerParty>
 
	
	<cac:PaymentMeans>
		<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>
		<cbc:InstructionNote />
	</cac:PaymentMeans>

	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">45.00</cbc:TaxAmount>
	</cac:TaxTotal>
<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">45.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">900.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">45.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
				<cbc:Percent>15.00</cbc:Percent>
                
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
        	</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	
	<cac:LegalMonetaryTotal>
	<cbc:LineExtensionAmount currencyID="SAR">900.00</cbc:LineExtensionAmount>
	<cbc:TaxExclusiveAmount currencyID="SAR">900.00</cbc:TaxExclusiveAmount>
	<cbc:TaxInclusiveAmount currencyID="SAR">1035.00</cbc:TaxInclusiveAmount>
     <cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount> 
	<cbc:PayableAmount currencyID="SAR">1035.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">3</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">900.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">45.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">1035.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>جلسة نور 1</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">300.00</cbc:PriceAmount>
            <cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>

Thank you for your support

@CDAdeveloper

900 * 15% = 135 // Not 45

Maybe you should buy new Calculator… :wink: :grinning:

<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">135.00</cbc:TaxAmount>
	</cac:TaxTotal>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">135.00</cbc:TaxAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">900.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">135.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
				<cbc:Percent>15.00</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:LegalMonetaryTotal>
		<cbc:LineExtensionAmount currencyID="SAR">900.00</cbc:LineExtensionAmount>
		<cbc:TaxExclusiveAmount currencyID="SAR">900.00</cbc:TaxExclusiveAmount>
		<cbc:TaxInclusiveAmount currencyID="SAR">1035.00</cbc:TaxInclusiveAmount>
		<cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
		<cbc:PayableAmount currencyID="SAR">1035.00</cbc:PayableAmount>
	</cac:LegalMonetaryTotal>
	<cac:InvoiceLine>
		<cbc:ID>1</cbc:ID>
		<cbc:InvoicedQuantity unitCode="PCE">3</cbc:InvoicedQuantity>
		<cbc:LineExtensionAmount currencyID="SAR">900.00</cbc:LineExtensionAmount>
		<cac:TaxTotal>
			<cbc:TaxAmount currencyID="SAR">135.00</cbc:TaxAmount>
			<cbc:RoundingAmount currencyID="SAR">1035.00</cbc:RoundingAmount>
		</cac:TaxTotal>
		<cac:Item>
			<cbc:Name>جلسة نور 1</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">300.00</cbc:PriceAmount>
			<cbc:BaseQuantity>1</cbc:BaseQuantity>
			<cac:AllowanceCharge>
				<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
				<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
				<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
			</cac:AllowanceCharge>
		</cac:Price>
	</cac:InvoiceLine>
1 Like

@muhammad

I don’t think so, We should report the invoice according to the invoice in our erp. Quantity, Price, Discount, Charge, Vat, etc., unless it can’t be handled in the eInvoice specification