My understanding is this - but I am open to correction.
If you are trading in your car & going for another hp agreement, a trade-in value for your current car will be deducted from the new car & a new agreement will be set up. So, currently you owe approx. €21.5k. Say a value of €18k is put on your car, you will carry 3.5k into the new agreement.
My own personal opinion is that hp is a minefield......a loan is preferable as you can sell the car at any time & pay back the loan. With hp, you can't sell the car as you don't own it.