The best would be to Invalidate those Payables (purchase invoice):
Open Payable and then from Record menu select: Invalidate.
and then you can close the Purchase Order and create a new one to the correct Vendor.
If you are not able to invalidate, then you need to create Credit memo for both of them and again close the PO.
HansaWorld Support Team