Technically, automatic credit allocation is always by due date. If due date is not specified then Manager will use issue date as due date.
In this case, because due date wasn’t specified on invoice 4526, Manager assumed due date is on the same date as issue date - 24/08/2017 which was earlier than any other invoice coming due (as other invoices had due date specified).
I forgot why is it this way but I think it has something to do how many businesses don’t use due dates and when they do on occasional invoice, it doesn’t get matched against payments from customers earlier than necessary.
By the way, I’m currently working on slightly different approach to automatic credit allocations. The idea is good but the implementation is causing too many issues all over the place. New approach should retain the benefits while giving more transparency into the allocation process. Right now it’s “too magical”.