When you receive an excess payment from a customer or record a single payment to multiple invoices, the payment is generally tracked under Unearned Revenue.
Assume the case, where you receive $1000 from a customer. This is applied to 4 invoices, worth $250 each. If you check the transaction movement, it will look like,
Payment
Unearned Revenue - $1000 (Credit)
Cash/Bank - $1000 (Debit)
Invoice1
Accounts Receivable - $250 (Credit)
Unearned Revenue - $250 (Debit)
Invoice2
Accounts Receivable - $250 (Credit)
Unearned Revenue - $250 (Debit)
Invoice3
Accounts Receivable - $250 (Credit)
Unearned Revenue - $250 (Debit)
Invoice4
Accounts Receivable - $250 (Credit)
Unearned Revenue - $250 (Debit)
To the cash/bank account, it is a single payment, from an intermediate account, Unearned Revenue. For each of the invoices, the transactions will be recorded between AR and UR so that, at the end, the Unearned Revenue balance turns nil.
Similar case applies for Vendor Payments in excess or for multiple bills.