Several invoices.
On the client's page, choose Record payment beside Create invoice or the outstanding balance. Enter the receipt: open invoices fill oldest due first. Change each allocation before saving. Starting from a project puts its invoices first.