A SHALI'ACH WHO DEVIATED [Shelichus: Shinuy]
Gemara
(Beraisa #1): If Levi gave money to a Shali'ach (Shimon) to buy wheat, and he bought barley with it (or vice-versa), if the grain went up or down in value, Shimon takes the gain or loss.
Contradiction (Beraisa #2): If the grain went down in value, Shimon suffers the loss. If it went up in value, they share the gain.
Answer #1 (R. Yochanan): Beraisa #1 is like R. Meir, who holds that Shinuy Koneh (one acquires through change). Beraisa #2 is like R. Yehudah, who holds that Ein Shinuy Koneh.
Objection (R. Elazar): Perhaps R. Meir holds that Shinuy Koneh only when Levi wanted something for his own use, for then he has use only for that. However, when Levi wanted merchandise, he is happy with anything that goes up in price!
Answer #2 (R. Elazar): Both Beraisos are like R. Meir. In Beraisa #1, Levi wanted grain to eat. In Beraisa #2, Levi wanted merchandise.
People in Eretz Yisrael derided R. Yochanan's answer. According to R. Yehudah, how does Levi acquire half the grain (to share the profit)? The seller did not know (that Shimon deviated) to intend that Levi should acquire!
Question (R. Shmuel bar Sasarti): If so, even when he bought like Levi requested, how does Levi acquire?
Answer (R. Avahu): When he buys what Levi wanted, it is as if Levi bought it.
(Mishnah): If Levi made (all) his property Hekdesh, the Gizbar may not take (to be Hekdesh or for collateral) clothing that Levi bought for his wife.
Question: Why don't we say that the seller of clothing did not know to intend that the wife should acquire!
Answer #1: Levi is like a Shali'ach of his wife. It is as if she bought it;
Rejection #1 (and Answer #2 - R. Aba): Levi was not her Shali'ach (the clothing is not hers). Rather, one who is Makdish does not intend for his wife's clothing.
Rejection #2 (and Answer #3 - R. Aba): (Levi was not her Shali'ach.) When one is Makdish, it is as if he gave his wife ownership of her clothing beforehand.
Rishonim
Rif: Since the Halachah follows R. Yehudah who says that Ein Shinuy Koneh, if he gave money to buy merchandise in partnership, Shimon suffers any loss, for he deviated. If there was a gain, they share it. This is even like R. Meir. Since he gave the money for business, Shimon did not acquire through Shinuy. If he gave to buy merchandise, and Shimon is not a partner, he has no share in the gain. Shimon suffers any loss, for he deviated. If there was a gain, it is all Levi's. The same applies if he gave money to buy wheat to eat and Shimon bought barley. Shimon suffers any loss, for he deviated. If there was a gain, it is all Levi's. Shimon shares the gain only when the money was given for a partnership.
Rambam (Hilchos Sheluchim 1:5): If Levi gave money to Shimon to buy wheat for business or to eat it, and he bought barley with it, or vice-versa, if there was a loss, Shimon suffers it, for he deviated. If there was a gain, Levi gains.
Rambam (5:2): If one gave money to his friend for a partnership to buy wheat for business, and he bought barley with it, or vice-versa, if there was a loss, Shimon suffers the loss, for he transgressed. If there was a gain, they share the gain.
Rosh (9:18): R. Yochanan establishes Beraisa #1 like R. Meir, who holds that Shinuy Koneh. Therefore, the loss or gain is Shimon's. Beraisa #2 is like R. Yehudah, who holds that Ein Shinuy Koneh. Therefore, it is as if he did not deviate. If the money was for a partnership, they share the gain. If it was regular Shelichus, all the gain is Levi's. However, if there was a loss, Levi says 'I made you a Shali'ach to help me, not to harm me.' R. Elazar establishes both Beraisos like R. Meir. In Beraisa #1 Levi wanted wheat to eat. In Beraisa #2, he wanted merchandise. Since we hold like R. Yehudah, it makes no difference what he wanted. If he was a Shali'ach, Shimon suffers any loss and Levi receives any gain. If it was a partnership, they share the gain.
Hagahos Ashri: A case occurred in which Levi gave money to his Shali'ach to buy a certain merchandise, and he bought a different merchandise, and claimed that he bought for himself. The Rivam ruled that the Shali'ach gets all the gain, and swears that he intended for this. This is like Rabbeinu, who says that one can establish himself to be a Rasha to exempt himself from money. My father said one can never establish himself to be a Rasha. Here he is believed because he wants to pay. What he did was permitted.
Poskim
Shulchan Aruch (CM 176:11): If one gave money to his friend for a partnership to buy wheat for business, and he bought barley with it, or vice-versa, Shimon suffers any loss, for he transgressed. If there was a gain, they share the gain.
Gra (64): In Siman 183, the Shulchan Aruch wrote (that Levi gets the entire gain) whether he sent to buy for business or to eat. This is from the Rambam; the Rif agrees. They rule like the people of Eretz Yisrael. R. Aba answered the Mishnah according to them. They share the profits only if they were partners, but a Shali'ach always acquires for the Meshale'ach. The Rosh and other Poskim rule unlike the people of Eretz Yisrael. The Rema rules like them (even if they were partners, Levi gets all the profit whether he sent Shimon to buy for eating or for business).
Shulchan Aruch (183:5): If Levi gave money to Shimon to buy wheat, whether for business or to eat it, and he bought barley with it (or vice-versa), if there was a loss, Shimon suffers the loss. If there was a gain, Levi gains.
Beis Yosef (DH veha'Itur): The Rif explained that Shimon (shares the profits when he) was a partner. Ba'al ha'Itur disagrees, for 'Shali'ach' connotes that he is not a partner. Also, if so, why didn't the Tana teach a case when (he is not a partner, and) Levi gets all the profits?! Also, R. Elazar said 'perhaps R. Meir said Shinuy Koneh only when Levi wanted for his own use.' I.e. in such a case they share the profits, even though he is not a partner, like the case of a craftsman (about which R. Meir said that Shinuy Koneh)! Rather, the Shali'ach was not a partner. If he did not find wheat to buy, and bought barley, for there will be no profit if he returns the money, they share the profit. They argue about a Shali'ach to buy wheat to eat. R. Meir holds that Shinuy Koneh, and (he keeps the entire profit. R. Yehudah holds that Ein Shinuy Koneh. This is like Shelichus for business, and) they share the profit. Levi gets the entire profit only when there was no deviation. The Rif, Rambam and Rosh agree, so we follow them.
Beis Yosef (DH Mashma): The Mordechai (122) connotes that if the Shali'ach deviated because he thought that other merchandise will be more profitable, he is not considered a thief. If he were a thief, they would not share the profit.
Shach (9): The Shali'ach suffers the loss if the price of the item declined. If an Ones occurred which is not due to his Shinuy, or it was stolen or lost, the Shali'ach is exempt.
Shach (10): Ba'al ha'Itur holds that even though we rule like R. Yehudah, since the Shali'ach caused the gain, he gets half. Even though many hold like the Shulchan Aruch, a Shali'ach can say 'I hold like the Ba'al ha'Itur.'
Rema: The same applies if the Shali'ach was a partner in the venture.