Calculation of trade discounts