Calculation of discounts and sales tax