In the case where a release capital request is reconciled with a credit
note(when you want to cancel properly a capital release request from an
accounting point of view). In the confirm_paid function the order of the
invoices are not always the same. Some time you get the credit note
first and some times you get the original invoice first. it leads to
problem in case of the credit note go first. this commit fix the
problem.