Applying automatic discounts to customers