Purchase invoice got auto paid using old payments

Not sure how but one of my purchase invoice is auto paid using old payments made to the supplier.

You will have chack back through the suppliers account to see why these old payments were available to ve set iff against this invoice

It is normal behaviour to clear older invoices before newer ones and that is what the auto paid function does. I noticed this invoice now is cleared so not sure what the issue is.

Maybe you need to check the Payments, is there a Payment that does not select Purchase Invoice Reference and you make a Purchase between the Payment date?

There are some payments like that
So how can i resolve it ?