The settlement of the transactions on of the vendors and customers are usually done when the payments are processed. But there are cases when the settlement cannot be done while performing transactions.
The cases when settlements cannot be done while doing the transactions may be when returning items after the were invoiced, sending back the items to vendor after the items were invoiced, reversed pay statements etc.
In this article we will explain how to settle a sales order invoice and a return order invoice in Microsoft Dynamics 365. After both these invoices are completed there will be two open transactions for the customer.
In the image below there is the sales order line that was sold to the customer.

And in the following image is the transactions that is shown in the customer settlement transactions.

For some reasons this sales order needs to be returned and the items should be returned to stock.
To complete the request, we created a Return Order for the item on the image above. The return order is related to sales order. In the following image is the return order:

The Sales Order field in the image above represents the sales order related to the return order for the items to be returned. In order to process the return order invoice, we should go to the Sales order with the number on that field (in this example the number is 001011).
After the return order invoice is posted we can see the two transaction in the settlement form.
To open the settlement form, navigate to:
Accounts receivable -> Customers -> All customers
Or
Sales and marketing -> Customers -> All customers
Select the customer (in this case US-003) and on the ribbon click Collect -> settle -> Settle transactions as in the image below.

After clicking the settlement transactions, you will se the two transactions as follows:

The invoice CIV-00000728 is the sales invoice and the CCN-000001 is the return order invoice. As seen in the image above, the amount for sales order positive and the amount for the return order is negative. These to amount needs to be settled with each other.
To settle these transactions, we mark the transactions by clicking on the square in the Mark column and click Post.
After posting these two transactions will not show in the settlement transactions form.
This manual way of settling the transactions should be done on all transactions that were not settle even in the transactions that could be settled wile performing the transactions but were not done.