So, using the following links, it should be possible:
and this:
it should be possible to calculate the sales/purchase tax using the before_submit event. It will have to be a custom app
Let me experiment this week.