Manager will allocate customer credits, if they exist, to unpaid invoices, oldest first. You might find applicable information in this thread: Automated payments have caused overpayments? - #4 by jax, or in this Guide: Manager Cloud
Generally, to avoid automatic allocations, assign receipt of a payment from customer to Accounts receivabl
e and the specific invoice.