Payment entry is not associated to the sales invoice

Hello,

For a customer, I have created a sales note. That sales note is assigned a payment in advance.

When I created the corresponding sales invoice, it was correctly associated to sales note and through that, I can get the payment already made. However, that payment was not associated to the just emitted invoice.

How can I assigned it?

Thanks

Jaime