RE: Payment Application Batch Posted to Future Period
I believe you may be mistaken when you say that the same invoices were cleared in both batches. SL will not let you apply payments to an invoice in excess of the invoice amount. So, if the first payment batch was applied to an invoice clearing its balance then the second payment batch could not have been applied to the same invoice. I have seen a couple of instances where this did not apply but it was due to a very unusual set of circumstances. In such cases, the invoice in question ended up with a negative balance (which should never happen under normal circumstances). So, the only way that the second payment could have been applied to the same invoice as the first payment (you said "cleared" so I am assuming it was not a partial payment) would be if the application inquiry screen was already used to either void the first payment or un-apply it. If the later, then use the application inquiry screen to void the first payment.
You do not want to mess around with SQL statements to try and correct this unless you totally understand how the various tables (ardoc, artran and aradjust) all work together and how their contents affect reports like the aging reports and the trial balance report. The approach I indicated is the best way to address this issue.
The fact that you cannot see the future period payment batch in the GL does not affect the action to be taken. The void action on the application inquiry screen will create another GL batch backing out the effects of the first incorrect payment application batch.