Figure B: Discount calculation
The following figure shows how discounts are calculated: