Question
I am a rabbi and I had a din Torah recently between a plumber who was employed by a contractor on a building project and an apartment owner whose apartment was part of this project and built by this contractor. The contractor went bankrupt and never paid the plumber. The plumber argued that since he worked on this apartment and was not paid for his work, the apartment owner owes him money since the apartment owner benefited from his (the plumber's) work. The apartment owner answered that he paid the contractor in full and should not be asked to pay twice.
My first reaction was to accept the apartment owner's argument and dismiss the plumber's claim. However, I looked at your sefer, Mishpatei Yosher (1, page 306) where you discuss whether a shadchan who was asked by parents to find a shidduch for their children but was not paid by the parents can force the couple to pay him the money he deserves as a shadchan. You wrote that according to the Avnei Choshen the young couple has to pay since they benefited from the shadchan's work. Even though the shadchan expected at the time that he worked that he would be paid by the parents, nevertheless if they fail to pay, the beneficiaries of the shadchan's work, in this case the young couple, must pay.
Applying this logic, it would seem that even though the plumber expected to be paid by the contractor at the time that he worked, nevertheless, since the contractor failed to pay, the plumber can force the apartment owner to pay.
Is the analogy correct?
Answer
It is not correct and this is a very good illustration of how delicate the laws of Choshen Mishpot are. If even just one – maybe seemingly minor – detail changes, the law can change. The only way to arrive at correct decisions is to understand the rationale of every law.
Here, we will study the case of the shadchan and the sources, and then see if your situation is similar to the case of the shadchan. In Mishpatei Yosher we also wrote that the Chasam Sofer disagreed with the Avnei Choshen and we will explain his opinion as well in order to understand the basis of their dispute.
The case that the Avnei Choshen discussed was where someone asked an agent to hire workers to perform work for him for payment of three coins. Realizing that the going rate for performing this job was four coins, the agent offered the workers four coins and accepted personal responsibility to pay them the four coins.
The Avnei Choshen notes the ruling of the Sema: since the going rate was four, after the job was done the agent can force the employer to pay four since that is the benefit he had. The Avnei Choshen refutes the argument of the Sema since the employer explicitly told the agent that he would only pay three. He says, however, that he can achieve the same results as the Sema, namely to force the employer to pay four, by a different argument. His reasoning is that rather than the agent demanding four, the workers can force the employer to pay them four since their work was actually worth four and they were not told that they would only be paid three. Therefore, they can use their status as a yoreid (one who performed work but was not hired) vis-à-vis the person who benefited from their work to force him to pay them four since he did not hire them and did not discuss price with them, so he must pay the full value of the benefit he received. Furthermore, he is considered a yoreid bireshus, one who performs work with the permission of the beneficiary, since he was asked to do the work and thus is entitled to full payment.
The principle that can be derived from the Avnei Choshen is that even though the worker performed the work expecting to be paid by the agent as an employee, nevertheless, if he is not paid as an employee, he can demand payment from the beneficiary of his work as a yoreid. From this we deduced that someone who worked as a shadchan expecting to be paid by the parents who asked him to find a shidduch for their child, which effectively means that they hired him as their employee, but was not paid by the parents, can collect from the young couple, who are the beneficiaries of the shadchan's work, as a yoreid.
The critical point which you overlooked is that both in the situation of the Avnei Choshen and in the case of the shadchan, which we derived from the Avnei Choshen's ruling, the beneficiary did not pay for the benefit that he received. However, in your situation the beneficiary paid the contractor for the work of the plumber.
Moreover, this is the arrangement that the plumber agreed to when he agreed to work for the contractor. Workers are paid by the contractor and the beneficiary pays the contractor. This changes the halacha completely since we find in many cases in the Gemara and Shulchan Aruch that if A owes money to B and B tells A to pay C and A complies, B cannot ask A for the money even if C did not give him the money that he received from A. This is essentially what transpired in your case since the plumber effectively told the beneficiary to pay the contractor and he (the plumber) will get his money from the contractor. When the beneficiary paid the contractor, he in effect paid the plumber too.
Another illustration of this principle is the ruling of the SA (CM 190, 3) that if A sells B a parcel of land and A tells B to remit his payment to C, if B complies, he acquires the land, since by paying C, it is considered as if he paid B, since B requested that he remit his payment to C. This is a general principle which is called by the Gemara (Kiddushin 7A) the Law of Oreiv-cosigners, since it is derived from the concept of cosigning. Cosigner B becomes liable for a loan that A grants C, even though B himself did not receive any money. He becomes liable because he in effect told A that by giving money to C it is as if A gave him the money. Similarly, when A, the seller, tells B to remit his payment to C he in effect told him that by paying C he is paying him.
Similarly, in your case since the plumber agreed to work for the contractor who will pay him for his work, he in effect told the property owner that if he pays the contractor, he will not owe him any money. Therefore, even the Avnei Choshen would agree that here the plumber has no claim against the beneficiary of his work.
We note that besides this point, the plumber could not force the homeowner to pay him his salary for another reason. As we wrote in the Mishpatei Yosher, the position of the Avnei Choshen, that an employee can collect from a beneficiary if the beneficiary did not pay anyone for his benefit, is disputed by the Chasam Sofer (BM 14B). The Chasam Sofer discusses the Gemoro that we cited at the outset about which the Sema and Avnei Choshen had their dispute, and says that the reason the Gemoro does not suggest the approach of the Avnei Choshen is because one who works as an employee can never demand payment from the beneficiary as a yoreid, even if the beneficiary did not pay anyone. The reason is that he worked expecting to earn money as an employee. He did not intend to bestow any benefit upon his beneficiary. Since he did not intend to bestow a benefit on the beneficiary he is not entitled to payment as a benefactor-a yoreid. We note that R. Akiva Eiger (Commentary to BM 14A) understands Rashi just like the Chasam Sofer.
However, even according to the Chasam Sofer the plumber is entitled to be paid something, just not necessarily the amount that he agreed with the contractor. The amount he receives is the minimum amount that plumbers who are as skillful as he, charge for their work. The reason he is entitled to this amount is because he worked, which is an expenditure of time, and thus is considered an out-of-pocket expense. Since the cost of time for a worker without a contract is the minimum amount that is charged by workers of his caliber, the plumber is entitled to this amount.
However, again, this only applies if the employer did not pay the contractor. Since in your case he did pay, according to all opinions, the plumber cannot force the employer to pay him anything.