For open invoices partially paid, consider the following example…
Subtotal /{ amt (net of tax) } =370.00 –> This amt is without tax
Discount Item= 0
Tax Total =55.50
Total /{ total gross amount } = 425.50
Amount Due / { amt remaining }= 287.50
Amount paid= 138.00
Since we need to get the amount remaining without tax , it can be considered in proportion as

Hence, 287.50 / 425.50 = amount remaining without tax / 370.00
Amt remaining without tax= 287.50*370/425.50 = 250.00
= amt remaining * Amt net of tax / total gross amt