Let's imagine an invoice:
Sub total: 100 (what we don't know)
Tax1 21%: 21 (this increases the total)
Tax2 10%: 10 (this de-increase the total)
TOTAL: 111
For a single tax we could do:
100 (total) * 100 / (21 + 100) = 82.64 (sub total)
But how can we calculate the sub total when having different percentages?
Note, every tax affects the original price only (without other taxes)
For example, for:
subTotal = 150 * 100 / (31 - 22 + 100)
subtTotal = 137.61