You are getting the vat amount from the page, working out the total, and then changing the vat amount. That results in problems for you.
Change your variable names to more expressive ones, and that will help you to see where the problem occurs.
For example, changing:
var vatAmount = subTotal - netSalesPrice;
Aside from that though, the fundamental problem that you have is that it's not appropriate to work out the total price before you've worked out the amount of VAT.
Using variables whose context can be understood at a glance helps you to discover such problems.