Item net price MUST equal (Gross price - Allowance amount) when gross price is provided.
If ram:ChargeAmount is provided for the gross price, the net price’s ram:ChargeAmount does not equal the gross price less the first available allowance ram:ActualAmount. If no allowance amount is present, the calculation uses zero.
The net price is derived from the gross price less the allowance on the price. Matching values ensure that the stated net price follows arithmetically from the price details.
The net price does not equal the gross price less the allowance stated at price level. Make sure these price amounts agree mathematically.
- Compare
ram:ChargeAmountinram:GrossPriceProductTradePricewithram:ChargeAmountinram:NetPriceProductTradePrice. - Account for the first available allowance
ram:ActualAmount. - Make sure the net price equals the gross price less that allowance.
- Generate the invoice again and validate it.
<ram:GrossPriceProductTradePrice> <ram:ChargeAmount>100</ram:ChargeAmount> <ram:AppliedTradeAllowanceCharge> <ram:ActualAmount>10</ram:ActualAmount> </ram:AppliedTradeAllowanceCharge> </ram:GrossPriceProductTradePrice> <ram:NetPriceProductTradePrice> <ram:ChargeAmount>95</ram:ChargeAmount> </ram:NetPriceProductTradePrice>
<ram:GrossPriceProductTradePrice> <ram:ChargeAmount>100</ram:ChargeAmount> <ram:AppliedTradeAllowanceCharge> <ram:ActualAmount>10</ram:ActualAmount> </ram:AppliedTradeAllowanceCharge> </ram:GrossPriceProductTradePrice> <ram:NetPriceProductTradePrice> <ram:ChargeAmount>90</ram:ChargeAmount> </ram:NetPriceProductTradePrice>
Technical details
If ram:ChargeAmount is absent from the gross price, the test passes. Otherwise, it compares the net price ram:ChargeAmount with the gross price less the first ram:ActualAmount; u:decimalOrZero treats a missing allowance amount as zero.
The rule applies to ram:GrossPriceProductTradePrice on an invoice line and compares its ram:ChargeAmount with ram:ChargeAmount in the adjacent ram:NetPriceProductTradePrice.
rule/@context)assert/@test)