Older customer payments allocated to new sales invoices

I am new to the management software.
I am having an issue with new sales invoices.
When i make a new sales invoice to customer its showing an old payment to the invoice and its not allocating it to old invoices.
I haven’t allocated those payments to older invoices.
Is there a way in which the software can allocated the payment to the oldest owing invoices.

the software allocates the receipts automatically to invoices with the oldest due dates first. please check if your older invoices have a due date which is later than the newer invoices.
else, you can manually allocate the receipt to particular invoices. please read the guide on Receipts & Payments.

Thanks. It worked.
I appreciate your swift response.