Cancelling of Payment Entry from the Invoice

Hi.
I have here a scenario where the Sales Order and Sales Invoice Items rate are not the same which is why the Sales Order was not completed after submitting the Sales Invoice. The correct rate for the Item was in the Sales Invoice, The thing is, the Sales Order cannot be amended anymore since the Sales Invoice was already submitted.

I have two scenario:

  1. Sales Invoice is unpaid
  2. Sales Invoice is paid

Here’s what I think the best to do to correct the transaction:
For Sales Order with unpaid Sales Invoice:

  1. Cancel the Sales Invoice
  2. After cancelling the Sales Invoice, cancel and amend the Sales Order with the correct rate of the Items and create a new invoice for it.

For Sales Order with paid Sales Invoice:

  1. Cancel the Payment Entry
  2. After cancelling the Payment Entry, cancel the Sales Invoice
  3. After cancelling the Sales Invoice, cancel and amend the Sales Order with the correct rate of the Items and create a new invoice for it.

My question is, is it okay to cancel the Payment Entry for the Paid invoice? If no, what is the best to do in regards with this situation?

Thank you!