If a customer has several invoices open, QuickBooks matches the payment to the invoice of the same amount. If that's not right, you can change how the payment is distributed by changing the amounts in the Payment column.