You delete a contract or a purchase from the list in Purchasing: check the row and choose Delete in the menu. First check that no invoices are linked to the contract.
How to do it
Go to Purchasing in the menu.
Find the contract and check whether it has invoices linked to it. If it does, move the link to the right place first.
Check the row in the checkbox on the left. You can select several rows at once.
Choose Delete in the menu that appears. If several rows are selected, you find the menu at the checkbox in the table header.
Good to know
When the contract is deleted, the final forecast on the production code goes back to the estimate or to the remaining contracts.
Test purchases and planned purchases can also be deleted afterwards.
You can also delete a contract with Delete at the bottom left of the Edit contract dialog.
If the contract is simply on the wrong production code, you can edit it and choose the right code instead of deleting it.

