I believe the important thing is not to try to force this to be a single transaction in Manager, even though everything may be documented on one piece of paper from the supplier. In reality, several things have happened. Here are several thoughts, not necessarily in any order.
The old machine is a disposed fixed asset. You have, in effect, sold it back to the supplier. Because there is undepreciated value remaining, enter a receipt or sales invoice for the amount the supplier allowed on the old machine. Post the transaction to Fixed assets. Then follow this Guide: Dispose of fixed assets | Manager to dispose of the asset.
Enter the new fixed asset at its purchase price. Use a purchase invoice for this. Also post to Fixed assets. The other items can be on the same purchase invoice, posted to their appropriate accounts.
I don’t know your tax law, so I don’t know whether you are required to collect VAT from the supplier for the old machine you are selling back to him. If so, select the right tax code for the receipt. Thus, VAT on purchase and sale would offset, although the time separation is two years.
Or, your tax law may allow you to simply offset the trade-in value of the old machine, effectively reducing the price of the new machine. If so, change its price on the purchase invoice to reflect the trade-in.
If I understand what you have described correctly, I don’t see why there is a credit. According to my understanding, you paid more for the new machine than the allowance for the old machine.
I also don’t see why you want to include tax on any profit in this transaction. Whether you made or lost money selling the old machine back, the amount will show up in Fixed assets - loss on disposal. You will pay income tax on that profit as part of your regular income tax filing, not as part of this transaction.
I am sorry this all sounds so confusing. You probably need to consult a local tax expert before figuring out exactly how to enter everything.