RE: Remove credit memo and invoice applied to wrong invoice
For question #1, if the credit memos aren't fully applied, you can just go to Purchasing > Transactions > Apply Payables Documents, unapply the credit memos to the invoices and then apply to other invoices.
If the credit memo is fully applied to the invoices, the credit memo was moved to history. Your only option is to void the credit memo, reenter, post and then apply to the correct invoice(s).
For question #2, if the payment isn't fully applied, you can go to Purchasing > Transactions > Apply Payables Documents, unapply the payment and apply to a different invoice.
If the payment is fully applied, it was moved to history. You'd have to void the payment, reenter, post and then apply it to the other invoice.
In the Professional Services Tools Library, there is a utility to do this for Receivables Managment transactions -- exactly your situation (just in Sales instead). I sure wish there was something in it for Payables to avoid all the voids and reentering.
I hope this helps.
Thanks.
Joe