...
When dealing with prorated adjustements adjustments which are percentages, the behavior is as follows:
...
we calculate the effective amount by applying the percentage to the invoice sub-total and then prorate that amount like any other amount-based prorated adjustment. Given this approach, prorating percentage adjustments by quantity is now possible, whereas it was previously considered not applicable.
Fractional Pennies
When working with prorated adjustments, we need to make sure that the sum of the invoiceLine adjustments is equal to the prorated adjustment for which they represent. This means special handling of adjustments of amounts/percentages which don't distribute evenly.
...
POC code demonstrating these calculations: ProratedAdjustmentsPOC.java NOTE this code is intended to be illustrative. It has not been refined or optimized and probably does not meet the quality standards of our production code.
...