Payments are automatically applied to 'accounts payable' bill when the balance for supplier is in negative, i.e., if the supplier already has funds from you. This commonly happens in the following scenario:
Step 1) You entered new accounts payable bill, say PRC10001 for supplier A for $20.
Step 2) You applied payment of $20 to the above entered bill PRC10001 for the supplier A, making it fully paid.
Step 3) You then deleted the bill PRC10001 (but not the payment) for whatever reason.
[supplier A's account should show negative balance of -$20, because the payment was not deleted.
Step 4) You entered a new accounts payable bill PRC10002 for suppler A for $50.
[Now, the above payment $20 will automatically be applied to the bill PRC10002, making it partially paid, and the due amount of $30]
==============================================================================
If you want to delete a payment for an accounts payable bill, you should do it from 'View -> 'Payments of Accounts Payable' window, and not from Journal window or anything else. Actually, I never delete/touch anything from Journal window. This leads to problems, as it only deletes journal entries, not actual bills and payments.
Note that 'View -> Payments' is for payments received from customer, and 'Payments of Accounts Payable' is for payments made to supplier.
I always delete a payment first, before deleting the accounts payable bill. This helps me keep track of things.
======================================================================================
If it does not solve your problem, write me a private post with more details and screen-shots of Suppliers, Accounts Payable, Payments of Accounts Payable, and Supplier Statements windows. I would be happy to look into it.