How to delete auto generated comments in erpnext?

I am unable to delete the auto generated comment in erp. It is displaying this dialogue, kindly let us know what should be done to delete. Please refer the attachment

@eitadmin
why you want to delete an auto-generated comment. It is helpful for your reference. But you can delete your own (which is not auto generated) comments.

frappe does not allow you to delete auto-generated comments.

@Sangram
We want to delete the auto generated comment because for few sales invoice which is linked with payment entries ( we have received the amount before itself ). In this sales invoice we have some change to be made according to the customers demand for this we have to cancel and delete those sales invoice entries, which unfortunately we could not do.
From Sales Invoice
Error occurs with this quote: Cannot delete or cancel because Sales Invoice SINV-00xxx is linked with Payment Entry Reference 6802a20502

From Payment Entry
Error occurs with this quote: Cannot delete or cancel because Payment Entry PE-000xx is linked with Sales Invoice Advance 871f369f62

@eitadmin

your issue is different. Actually, Payments entry is linked with your sales invoice. So, first delete the linked Payment entries first and then delete Sales Invoice.

@Sangram
We have did all your procedures before itself. But still we are facing this error.

FYI:
During some situation we will enter the Payment Entry before Sales Invoice. And after this sales invoice will be linked with the payment entries. Changes may happen in this sales invoice so we need to cancel and delete it.

@Sangram
Sir, Awaiting for your valuable reply…

@eitadmin
Cancel the Sales Invoice . It will break linking of Invoice and Payment Entry and then delete it.

Already i tried to cancel but i can’t.
If i try to cancel and delete from Sales Invoice it shows below error msg like
Error occurs with this quote: Cannot delete or cancel because Sales Invoice SINV-00xxx is linked with Payment Entry Reference 6802a20502
If i try to cancel and delete from Payment Entry it shows below error msg like
Error occurs with this quote: Cannot delete or cancel because Payment Entry PE-000xx is linked with Sales Invoice Advance 871f369f62

please reply me.

@Sangram

Waiting for your reply.

Hope you can give correct solution.

@eitadmin

Maybe you did something wrong.
I checked on latest version by creating Payment Entry and Sales Invoice. It allow’s me to cancel and delete.

@Sangram

Brother,
Please create one payment entry(date: 07-Dec-2016) then create sales invoice(date: 04-Dec-2016) and click advance payment to link payment entry.

now try to cancel and delete both.
FYI:
Installed Apps
ERPNext: v7.1.7
Fleet Management: v0.0.1
Frappe Framework: v7.1.6