Invoice line net amount

Warning PEPPOL-EN16931-R120 Peppol

Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount

Recommendation: The invoice remains valid but should be corrected so that it can be processed automatically.
What is wrong

The invoice line net amount does not match the checked calculation: invoiced quantity multiplied by net price divided by the price base quantity, plus the line charges and minus the line allowances. The rule takes the tolerance value supplied to u:slack into account.

What the rule means

The net amount of an invoice line represents the amount for the invoiced quantity, adjusted for line-level charges and allowances. These values must agree so that the line amount is arithmetically consistent.

Please align the invoice line net amount with its calculation

An invoice line net amount does not match the calculation using quantity, price base quantity, net price, charges, and allowances. Review the amounts in that calculation so they agree with the line net amount.

What to do
  1. Check the invoiced quantity and net price for the invoice line.
  2. Account for the price base quantity and the invoice line’s charges and allowances.
  3. Compare the result with the invoice line net amount.
  4. Generate the invoice again and validate it.
Technical details

The check compares the net amount with the formula using quantity, net price, price base quantity, total charges, and total allowances. u:slack applies the supplied tolerance to the comparison.

Where the rule applies

The rule applies to each ram:IncludedSupplyChainTradeLineItem and checks the invoice line net amount against the quantity, net price, price base quantity, and the line’s charges and allowances.

Context (rule/@context)
ram:IncludedSupplyChainTradeLineItem
Test expression (assert/@test)
u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, $slackValue)