You will need to invoice your original PO and then issue a Credit Memo to the Supplier...on this invoice post to the inventory account.
Then go to your chart of accounts and for inventory accounts on the balance sheet, turn direct posting OFF. This will stop this from happening again.
PS - turn off direct posting for bank, AR, AR and Fixed Assets also