I'll try to explain it.
The DDE discount is taken off of the bill, then the gratuity is added on, but keep in mind that you pay gratuity on the pre-discounted amount. This is important to remember, that whenever paying your bill, you are suppose to tip on the total before discount. You may notice that when the server gives you your bill, you sometimes will find two different receipts. This is the servers way of reminding you what the TRUE total was, so that you can tip accordingly and not tip on the discounted total. So when you have a party of 8, the tip the restruarant will add will be 18% of the total before discount. Hope that makes sense.