Error BR-KSA-80 Prepaidamount

I got this error when i have discount on invoice line and i dunno whats problem
cac:Delivery
cbc:ActualDeliveryDate2024-08-25</cbc:ActualDeliveryDate>
cbc:LatestDeliveryDate2024-08-25</cbc:LatestDeliveryDate>
</cac:Delivery>
cac:PaymentMeans
cbc:PaymentMeansCode42</cbc:PaymentMeansCode>

</cac:PaymentMeans>
<cac:AllowanceCharge>
	<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
	
	
	<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
	<cac:TaxCategory>
		<cbc:ID schemeID="6" schemeAgencyID="UN/ECE 5305">S</cbc:ID>
		<cbc:Percent>15.0</cbc:Percent>
		<cac:TaxScheme>
			<cbc:ID schemeID="6" schemeAgencyID="UN/ECE 5153">VAT</cbc:ID>
		</cac:TaxScheme>
	</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:TaxTotal>
	<cbc:TaxAmount currencyID="SAR">1304.35</cbc:TaxAmount>
</cac:TaxTotal>
<cac:TaxTotal>
	<cbc:TaxAmount currencyID="SAR">1304.35</cbc:TaxAmount>
	<cac:TaxSubtotal>
		<cbc:TaxableAmount currencyID="SAR">8695.65</cbc:TaxableAmount>
		<cbc:TaxAmount currencyID="SAR">1304.35</cbc:TaxAmount>
		<cac:TaxCategory>
			<cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
			<cbc:Percent>15.0</cbc:Percent>
			
			
			<cac:TaxScheme>
				<cbc:ID schemeID="6" schemeAgencyID="UN/ECE 5153">VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:TaxCategory>
	</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
	<cbc:LineExtensionAmount currencyID="SAR">8695.65</cbc:LineExtensionAmount>
	<cbc:TaxExclusiveAmount currencyID="SAR">8695.65</cbc:TaxExclusiveAmount>
	<cbc:TaxInclusiveAmount currencyID="SAR">10000.00</cbc:TaxInclusiveAmount>
	<cbc:AllowanceTotalAmount currencyID="SAR">0.00</cbc:AllowanceTotalAmount>
	<cbc:PrepaidAmount currencyID="SAR">0.0</cbc:PrepaidAmount>
	<cbc:PayableAmount currencyID="SAR">10000.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
	<cbc:ID>1</cbc:ID>
	<cbc:InvoicedQuantity>1.0</cbc:InvoicedQuantity>
	<cbc:LineExtensionAmount currencyID="SAR">3391.65</cbc:LineExtensionAmount>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">508.75</cbc:TaxAmount>
		<cbc:RoundingAmount currencyID="SAR">3900.40</cbc:RoundingAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">3391.65</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">508.75</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
				<cbc:Percent>15.0</cbc:Percent>
				
				<cac:TaxScheme>
					<cbc:ID schemeID="" schemeAgencyID="">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:Item>
		<cbc:Name>FLAT PLAIN 18 | فلات بلاين 18</cbc:Name>
		<cac:SellersItemIdentification>
			<cbc:ID>FLAT PLAIN 18</cbc:ID>
		</cac:SellersItemIdentification>
		<cac:ClassifiedTaxCategory>
			<cbc:ID>S</cbc:ID>
			<cbc:Percent>15.0</cbc:Percent>
			
			<cac:TaxScheme>
				<cbc:ID>VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:ClassifiedTaxCategory>
	</cac:Item>
	<cac:Price>
		<cbc:PriceAmount currencyID="SAR">3391.65</cbc:PriceAmount>
		<cac:AllowanceCharge>
			<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
			
			
			<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
		</cac:AllowanceCharge>
	</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
	<cbc:ID>2</cbc:ID>
	<cbc:InvoicedQuantity>2.0</cbc:InvoicedQuantity>
	<cbc:LineExtensionAmount currencyID="SAR">104.00</cbc:LineExtensionAmount>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">15.60</cbc:TaxAmount>
		<cbc:RoundingAmount currencyID="SAR">119.60</cbc:RoundingAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">104.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">15.60</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
				<cbc:Percent>15.0</cbc:Percent>
				
				<cac:TaxScheme>
					<cbc:ID schemeID="" schemeAgencyID="">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:Item>
		<cbc:Name>SMOOTH 128 mm | مقبض سموث 128 مم</cbc:Name>
		<cac:SellersItemIdentification>
			<cbc:ID>K409220160-66</cbc:ID>
		</cac:SellersItemIdentification>
		<cac:ClassifiedTaxCategory>
			<cbc:ID>S</cbc:ID>
			<cbc:Percent>15.0</cbc:Percent>
			
			<cac:TaxScheme>
				<cbc:ID>VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:ClassifiedTaxCategory>
	</cac:Item>
	<cac:Price>
		<cbc:PriceAmount currencyID="SAR">52.00</cbc:PriceAmount>
		<cac:AllowanceCharge>
			<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
			
			
			<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
		</cac:AllowanceCharge>
	</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
	<cbc:ID>3</cbc:ID>
	<cbc:InvoicedQuantity>8.0</cbc:InvoicedQuantity>
	<cbc:LineExtensionAmount currencyID="SAR">5200.00</cbc:LineExtensionAmount>
	<cac:TaxTotal>
		<cbc:TaxAmount currencyID="SAR">780.00</cbc:TaxAmount>
		<cbc:RoundingAmount currencyID="SAR">5980.00</cbc:RoundingAmount>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="SAR">5200.00</cbc:TaxableAmount>
			<cbc:TaxAmount currencyID="SAR">780.00</cbc:TaxAmount>
			<cac:TaxCategory>
				<cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
				<cbc:Percent>15.0</cbc:Percent>
				
				<cac:TaxScheme>
					<cbc:ID schemeID="" schemeAgencyID="">VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:Item>
		<cbc:Name>TANDEMBOX PLUS INNER PULL OUT DRAWER 500MM FOR CAB. SIZE 45-60CM | درج تاندم بوكس بلس انر (45 - 60 سم)</cbc:Name>
		<cac:SellersItemIdentification>
			<cbc:ID>DW-5BL358M5002S-1</cbc:ID>
		</cac:SellersItemIdentification>
		<cac:ClassifiedTaxCategory>
			<cbc:ID>S</cbc:ID>
			<cbc:Percent>15.0</cbc:Percent>
			
			<cac:TaxScheme>
				<cbc:ID>VAT</cbc:ID>
			</cac:TaxScheme>
		</cac:ClassifiedTaxCategory>
	</cac:Item>
	<cac:Price>
		<cbc:PriceAmount currencyID="SAR">650.00</cbc:PriceAmount>
		<cac:AllowanceCharge>
			<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
			
			
			<cbc:Amount currencyID="SAR">0.00</cbc:Amount>
		</cac:AllowanceCharge>
	</cac:Price>
</cac:InvoiceLine>

Dear @wael

Thank you for reaching out.

You can refer to the sample XMLs in SDK to correct your calculations. Also, you can find the mapping between the business term, term ID, and the XML tag in the Data Dictionary.

If you fix your calculations and still facing issues, please share the full XML file with our support team via email:

SP email: sp_support@zatca.gov.sa

Thanks,

thanks for feedback, checked XML from SDK , and found extra tags not related to item line ,so i removed and its working now