Error in payment entry

Hello,

i am trying to insert payment entry for supplier. All fields was populated as usual but i can’t save document. Message is

Capture1

Bellow in Allocate Payment Amount i found both Purchase Invoices, submited and canceled 80-1, 80-2

I goes back in Purchase Invoice and cancel and delete 80-2, and after that try to delete 80-1 to fix the problem but he gives me error again

Capture

couldnt delete this record.

you should first delete GL Entry GL0007394 after that you can delete Purchase Invoice

I try to delete GL entry but gets new error message again

Capture5

Is GL Entry GL0007394 linked to any other transaction?

I think you should skip those cancelled Invoices in the reference. If they are cancelled, then they are of no use.