PintLint

Rules / ALIGNED-IBRP-004

Item net price must equal (Gross price - Price discount) when gross price is provided

Item net price (ibt-146) must equal (Gross price (ibt-148) - Price discount (ibt-147)) when gross price is provided.

Fails

<cac:Price>
  <cbc:PriceAmount currencyID="AED">95.00</cbc:PriceAmount>
  <cac:AllowanceCharge>
    <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
    <cbc:Amount currencyID="AED">10.00</cbc:Amount>
    <cbc:BaseAmount currencyID="AED">100.00</cbc:BaseAmount>
  </cac:AllowanceCharge>
</cac:Price>

Fix

When the gross price is given, set cbc:PriceAmount (net price) to cbc:BaseAmount (gross price) minus the price discount cbc:Amount: 100.00 − 10.00 = 90.00.

Schematron
Context
cac:Price/cac:AllowanceCharge
Test
not(cbc:BaseAmount) or (../cbc:PriceAmount castable as xs:decimal and cbc:BaseAmount castable as xs:decimal and cbc:Amount castable as xs:decimal and xs:decimal(../cbc:PriceAmount) = xs:decimal(cbc:BaseAmount) - xs:decimal(cbc:Amount))

Official text: Item net price (ibt-146) MUST equal (Gross price (ibt-148) - Price discount (ibt-147)) when gross price is provided.

Official · PINT AE (UAE) rules. Severity: error. Runs on UBL XML.

Check your invoice for this rule