Calculation of discounts and taxes