fixed bugs when using multi items discounts

1. fixed bug to allow usage of discount_amount2 and discount_rate2 when
discount_amount = 0 or disocunt_rate = 0, so that discounts are allowed
for two or more items (according to spec)

2. fixed creation of the hidden discount field

3. fixed discount_num usage to be the maximum number discount items as
it should be according to the spec and not all the discount at once.