delete a payment in the bank and delete a NC in custome account

I use sage 50 and the operation is wrong.
I should delete payment first, and then delete invoice.
As a result, the order was reversed.
Now there is a note de credit in the custome account, and the payment in the bank account cannot be deleted.
How to do it?