When the selling price does not include tax
Output tax = selling price * 17% (for general VAT payers)
When tax is included, then Output tax = Selling price/(1+17%)*17%
When you know the difference between the selling price and the purchasing price, then you will be able to calculate the input tax as well
And then, you will be able to figure out the VAT payable. It's done.