Cart: Fix for discount calculation bug

Quanity was not always taken into consideration when calculating actual
amounts. This commit fixes that.

Also adds test for verifying the correctness of the logic.

ping @MrShish 
got a bit confused by this.
so this is a discount that has a quantity +1 but amounts/perc in negative.
What happens if you inverse this?