Machine learning solution approach to match loan repayments
I don't think machine learning is the right tool.  It's difficult (at least for me) to formulate this as a learning problem.

You could consider genetic algorithms as an alternative approach.  Based on your description of how you do the matching by hand, it seems like the following assumptions hold:


You're looking for an assignment of payments to loans such that the difference between (principle + interest) and $\sum debits$ is minimized
You favor solutions where the time between loan and repayment is minimized.


If the above is true, you may want to consider genetic algorithms as an approach.   For GAs, you need to specify a representation, an objective function, and mutation/crossover operations.  I think the following would work:  

Individuals in the population (i.e. candidate solutions) are represented as vectors of length $N$, where $N$ is the total number of debits.  Each entry in this vector assigns the debit to a credit.  For example, the individual $[1, 1, 2, 3, 2, 3]$ means that the first two debits are associated with the first credit, the third debit is associated with the second credit, the fourth debit is associated with the third credit, and so on.

The objective function that you wish to minimize is described by the two bullet points above.  I think it should be pretty easy to programmatically compute this function.  For each credit, compute the magnitude of the difference between (principle + interest) and $\sum debits$.  Sum these differences, then add a penalty for temporal separation between credit and repayment.  One easy-ish way to implement the penalty is to add the edit distance between a solution $V$ and its sorted counterpart $sort(V)$.  You'll want to play with the weight of the time penalty such that some delay between credit and debits is allowed, but you still favor quick repayments.

You'll need to pick suitable mutation and crossover operations.  For this representation, the traditional two-point crossover would likely work well, and uniform mutation would probably work fine.



As an aside, I sure hope this isn't a real-world approach to loan repayment matching.  You will wind up with some angry customers when a debit is inevitably assigned to the incorrect credit.