2.
When an accounting adjustment is made for goods sold or goods purchased, there is no payment or receipt of money. In case of sale there is creation of receivables and such receivables can be adjusted from any amount payable to the concerned party.
The party should be the same- from whom loan was taken and goods are sold. In such a situation, usually understanding is revised that the loan be treated as advance for supply of goods. This can be confirmed by the party.
Similarly in case of stock transfer ( presumably to agent) the amount received from agent is in nature of advance or securiity deposit against consignment and not loan. Even if initially it was loan, on understanding of stock transfer the loan assumed character of advance or security deposit agaisnt stock transfer. Necessary document for confirmation can be exchanged between parties.