Typically, sales and purchase documents are not directly linked.
However, it is possible to transfer the products from a sales document to a new purchase document by making use of the Clipboard feature in Megaventory.
So, for example, when editing a Sales Invoice you can click More > Pin Products to Clipboard and all the products in the invoice will be copied over to the Clipboard along with the correct quantities.
Following that, you can create, for example a Purchase Order, fill in the Supplier and then Paste the products from the previously filled clipboard.
That way you can create a Purchase Order which - although not directly linked - is based at a Sales document.