Workaround a value becoming negative when applying discount

This will not apply the final discount if the item price would become
negative. A proper fix should be implemented after 1.8 release

Change-Id: I0ac68b2253512662d9f5b135504dcbc64cae51f4
(cherry picked from commit fbe78e16ac59d752d912286d951c41da06433800)