When you apply a discount to your estimate or invoice, the discount is applied across all the line items in the document evenly. Here's a quick example to illustrate:
You have two line items. One is $100 and the other is $200.
You apply a 10% discount. Now your items are $90 and $180. Each one had 10% deducted from it.
If instead, you applied a $10 discount, now your items would be $96.77 and $193.33.
That's because one of your items was 1/3 of the total, and the other was 2/3 of the total, so the $10 discount was applied as 1/3 of $10 ($3.33) to the first item, and 2/3 of $10 ($6.66) to the second item.
Now that we understand how discounts apply across line items, we can look at how taxes come into the equation.
Taxes are only applied after the discount has been applied.
So in the case where we applied a 10% discount, if each item had a 5% tax, the tax would not be applied to $100 and $200, it would be applied to $90 and $180, giving you $94.50 and $189.
So we can break the subtotal down like this:
item 1 + item 2 = $300
- 10% discount = $270
+ 5% tax = total of $283.50
That's a brief overview of how taxes work when a discount is added. Try this out on your next estimate or invoice and you should have a much clearer understanding of how it works.