DT-CIUS-PT-170
The BT-146 must equal the grossPrice (Item gross price) minus the discount (Item price discount), with an acceptance range of 1.00 € (it does not mean that this tolerance is accepted by the customer).
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
cac:InvoiceLine/cac:Price | cac:CreditNoteLine/cac:Price
(not(exists(cac:AllowanceCharge/xs:decimal(cbc:BaseAmount))) and not(exists(cac:AllowanceCharge/xs:decimal(cbc:Amount)))) or ((cac:AllowanceCharge/xs:decimal(cbc:BaseAmount) - (cac:AllowanceCharge/xs:decimal(cbc:Amount))) <= (xs:decimal(cbc:PriceAmount) + 1.00) and (cac:AllowanceCharge/xs:decimal(cbc:BaseAmount) - (cac:AllowanceCharge/xs:decimal(cbc:Amount))) >= (xs:decimal(cbc:PriceAmount) - 1.00))
Checked with Portugal CIUS-PT Invoice (UBL), Portugal CIUS-PT Credit Note (UBL)