To associate return invoice lines with sales invoice lines; You need to click on the document lines and then click the " Sales Invoices for Returns" button.
The Sales Documents screen will be displayed.
You can select the document. Then you can select the items in the checkbox and click the Transfer Items button.
The relationship between sales return invoice lines and sales invoice lines will be shown in the "Return Relationships Based on Document Lines" section under the "Linked Documents" tab of the "Document Sales Information" screen.