bonobos/spree — pull request #34 by magnusvk (2014-06-06 16:30:35+00:00)
Title: Correctly limit a promotion to its maximum amount

You should never be able to reduce the price of an adjustable to less than
zero. Thus, we have to guard against a promo applying a discount larger than
the pre-promo amount.

However, as we also do recalculations, we cannot just use the post-adjustment
amount as a limit here. We have to use the pre-adjustment amount -- i.e.
pre-tax, pre-promotions. That is correct because a) tax gets calculated on the
post-promotion amount and b) there can only be one active promo per line item.

This comes from ongoing discussion in spree/spree#4775 and keeps us up to date
with what we are proposing to merge into upstream.