The way in which we prorate percentage adjustments is different from what was actually implemented. This was at least in part due to vague or confusing documentation, which has been updated on the wiki
In short, we first evaluate the percentage to an amount and prorate the amount like a regular amount-based prorated adjustment.
Given: An invoice has 3 lines:
- invoice.subTotal = $60
- invoice adjustment of 10% prorated by line (in addition to total)
Each line get an adjustment of $2.00 ($6 / 3 lines)
- $10 + ($2) = $12
- $20 + ($2) = $22
- $30 + ($2) = $32
- invoice.adjustmentTotal = $6.00
The same technique is used for prorating "By amount" and "By quantity"
NOTE: This means the invoice adjustments will have type "percentage" but corresponding invoiceLine adjustments will have type "amount".
- Prorating percentage adjustments is handled as described above.
- unit tests are updated
- API tests are updated