Discount before subtotal and after tax

See this thread: Invoice Calculation - Please help us!
Discussed multiple times already.