Try checking the box on the accounting period called "ALLOW NON-G/L CHANGES" (allownonglchanges)
A work around is to create a new payment, go to the credits tab and select the outstanding payment of 4k, then go to invoices tab and select the invoices you want to apply it against. You should see that the Payment Amount nets to zero but it applies your payment to the invoices.