I don't think that there is any efficient algorithm to determine which of the invoices the client desires to pay for; I would assume that the problem can't be solved in polynomial time. It is very similar to the subset sum problem, which is NP-complete, i.e. there is no known efficient way to calculate a solution for the problem (NP), and it is at least as hard to solve as the hardest problem for which a solution can be verified in polynomial time (NP-hard).

I would suggest that the client instead gets to choose which of the invoices to pay for.