We had two identical invoices to the same customer over a two month period and the customers payment came in just after the second invoice was created. The payment was applied to the newer invoice. Support have told me that the matching rule isn't very bright and this can happen. Seems like it should be quite basic to have the rule to always apply a payment to an older invoice where there are two invoices with the same amount. We were shown how to add rules but that didn't seem to help.