As far as I understand, the VAT should be calculated after any (coupon) discounts. For example, if the product selling price is 100€, but I give a 90% discount, a 24% VAT should be 2.4€, not 24€. Right now, it seems to be calculated the wrong way.
Perhaps I'm missing something, but please check.