
661 P.2d 937 (1983)
62 Or.App. 419
TRANSAMERICA INSURANCE GROUP, Respondent-Cross-Respondent,
v.
Harold W. ADAMS, Appellant-Cross-Respondent, and
William R. Whitt, Respondent-Cross-Appellant.
No. 124,108; CA A24217.
Court of Appeals of Oregon.
Argued and Submitted December 1, 1982.
Decided March 30, 1983.
*938 Mark K. Grider, Salem, argued the cause for appellant-cross-respondent. With him on the briefs was Asa L. Lewelling, Salem.
Randall B. Kester, Portland, argued the cause for respondent-cross-respondent, Transamerica Ins. Group. With him on the brief was Cosgrave, Kester, Crowe, Gidley & Lagesen, Portland.
Dell A. Alexander, Albany, argued the cause for respondent-cross-appellant, William R. Whitt. With him on the brief was Emmons, Kyle, Kropp & Kryger, Albany.
Before GILLETTE, P.J., and WARDEN and YOUNG, JJ.
GILLETTE, Presiding Judge.
Plaintiff insurer brought this proceeding in two counts, one for money had and received and one for restitution, seeking the return of certain monies it had paid to defendants pursuant to an order of a Workers' Compensation Board (Board) referee *939 that was later set aside by the Board.[1] Both defendants cross-claimed against each other, seeking indemnity. The trial court granted summary judgment for plaintiff. Defendants appeal the subsequent judgment entered pursuant to ORCP 67(B). We affirm.
Plaintiff provided workers' compensation insurance for Oregon Acoustics in August, 1970, when defendant Whitt was injured while working as its employe. Whitt filed a workers' compensation claim that resulted in an administrative award of permanent total disability on January 10, 1975. Plaintiff requested a hearing December 29, 1977, on the extent of Whitt's disability. Defendant Adams, an attorney, represented Whitt in that proceeding. A settlement of the claim was approved by a Board referee. Pursuant to the settlement, plaintiff paid to both defendants a total of $27,500.
By its own motion order dated August 11, 1978, the Board set aside the settlement order of the referee.[2] Defendant Adams then brought a declaratory judgment proceeding against Whitt and plaintiff, seeking to uphold the original settlement agreement. He failed. Adams v. Transamerica, 45 Or. App. 769, 609 P.2d 834 (1980).[3]
Because the disputed settlement agreement had been voided, plaintiff was required under the workers' compensation law to reinstitute monthly total disability benefits to Whitt. Whitt had personally received $20,625 of the $27,500 paid under the settlement; the balance, $6,875, had been retained by Adams for his attorney fee in the workers' compensation claim.[4] Whitt and Transamerica agreed to treat the $20,625 actually received by Whitt as an advance judgment against which a percentage of monthly benefits would be offset until it was fully accounted for.
Plaintiff brought this action against Whitt and Adams for the remaining $6,875. The trial court granted plaintiff's motion for summary judgment, holding as a matter of law that Whitt and Adams jointly and severally owed restitution to plaintiff in that amount. This appeal by each defendant followed.
Adams challenges the sufficiency of the complaint for the first time on appeal, arguing that the pleadings will not support the judgment. The complaint is therefore to be construed liberally in plaintiff's favor, all allegations are treated as true, and plaintiff is entitled to all reasonable inferences which could be drawn from the allegations. Collins v. Fitzwater, 277 Or. 401, 406, 560 P.2d 1074 (1977); Lincoln Loan v. State Hwy. Comm., 274 Or. 49, 52, 545 P.2d 105 (1976).
Adams contends that the complaint for money had and received and for restitution does not state a claim against him. He argues that, because the payment was made to Whitt, and because Whitt used part of that sum to satisfy his debt to Adams for attorney fees, no privity existed between plaintiff and Adams, leaving Whitt solely responsible.
The check was issued by plaintiff to Whitt and Adams jointly and required *940 joint endorsement. Whitt never actually received the $6,875 in hand; that amount was applied by Adams to Whitt's attorney fee. First National Bank v. Hovey, 34 Or. 162, 163-64, 55 P. 535 (1899), established that, in an action for money had and received,
"[w]henever one party has in his hand money which belongs to another, and which he is not entitled to and cannot in good conscience retain as against the other, the law, notwithstanding a want of privity between the parties, will imply a promise upon his part to pay it over, and require him to disburse the fund accordingly to the tenor of such implied obligation." (Emphasis supplied.)
See also Smith v. Rubel, 140 Or. 422, 13 P.2d 1078 (1932). The complaint was sufficient against Adams.
Adams next argues that an issue of fact exists with respect to his claim that a part of the $6,875 paid to him was for services to Whitt unrelated to the workers' compensation claim. He contends that he is in the position of
"[a] creditor of another * * * who has received from a third party [a] benefit in discharge of the [debt] [and] is under no duty to make restitution therefor, although the discharge was given by mistake of the transferor as to his interests or duties, [because] the transferee made no misrepresentation and had no notice of transferor's mistake." Restatement of Restitution, § 14(1), p. 55 (1937).
Adams was not in the position of a "transferee [who] did not have notice of the transferor's mistake." Adams had notice. He knew that his fee had to be approved pursuant to ORS 656.388(1). He knew or should have known that, when the settlement was set aside by the Board, his fee, as a part of that settlement, was also set aside.
Adams next argues that plaintiff paid defendants under a mistake of law and that, unlike cases involving a mistake of fact, a mistake of law is insufficient grounds for a claim for restitution. Restatement of Restitution, § 45, states:
"Except as otherwise stated * * *, a person who, induced thereto solely by a mistake of law, has conferred a benefit upon another to satisfy in whole or in part an honest claim of the other to the performance given, is not entitled to restitution."
On the other hand, restitution generally is allowed when a payment was made under a mistake of fact that induced belief that the other party was entitled to receive the payment, when in fact the sum was neither legally nor morally due the recipient, provided there were no circumstances that would make restitution inequitable. Smith v. Rubel, supra; Security Savings and Trust Co. v. King, 69 Or. 228, 138 P. 465 (1914).
Adams correctly asserts that plaintiff's mistake was one of law. However, the rule denying restitution where payment is made under a mistake of law is subject to an exception applicable to the facts of this case. Restatement of Restitution § 46 provides, in pertinent part:
"A person who has conferred a benefit upon another because of an erroneous belief induced by a mistake of law that he is under a duty to do so, is entitled to restitution as though the mistake were one of fact if
"* * *
"(d) The mistake was as to the validity of the judgment subsequently reversed."
Comment d to subsection (d) of § 46 refers to § 74, which states:
"A person who has conferred a benefit upon another in compliance with a judgment, or whose property has been taken thereunder, is entitled to restitution if the judgment is reversed or set aside, unless restitution would be inequitable or the parties contract that payment is to be final; if the judgment is modified, there is a right to restitution of the excess."[5]
*941 Whitt's right to recover for his compensable injury is governed by the workers' compensation law. ORS 656.001 et seq. His rights under the statute are in lieu of any remedy he might otherwise have under another statute or the common law. ORS 656.018(2). A referee's order has the force and effect of a judgment. See ORS 656.289(1). The order is final unless, within 30 days after the order is mailed to the parties, one of them requests review by the Board. ORS 656.289(3). In this case, the referee's order approving the parties' settlement had the effect of a judgment, and plaintiff's payment was pursuant to that judgment. Comment a to § 74 applies the rule when a judgment is set aside "because of errors of law" and states that restitution may be obtained through an "independent action of assumpsit."[6]
The referee's order in this case was equivalent to a judgment. The payment of a claim under the coercion of a judgment is an exception to the general rule denying restitution for payments made under a mistake of law.
Finally, Adams argues that plaintiff is estopped to receive restitution, because it affirmed a voidable transaction by entering into a new agreement  the agreement to offset the payment against future workers' compensation benefits  with Whitt while the monies involved were the subject of a pending proceeding. Adams relies on Restatement of Restitution § 68(1) (1937), which provides in part:
"The affirmance of a voidable transaction by a person, who, and who alone, can avoid it because of fraud or mistake terminates his right to restitution * * *."
The Restatement section relied upon is not applicable to this case. Transamerica has not "affirmed" any transaction with either Whitt or Adams. The trial court correctly granted plaintiff summary judgment against Adams.
We turn now to defendant Whitt's contentions. He urges that plaintiff is barred by res judicata from asserting the present claim, because plaintiff previously included this claim in a lawsuit between the same parties and received an unfavorable judgment on it. Whitt is correct that plaintiff, as defendant in an earlier lawsuit, Adams v. Transamerica, supra, alleged a counterclaim against him based on the same facts that are now alleged in this lawsuit. The trial court in that case, reversing the Board, approved the settlement between Whitt and plaintiff. Whitt appealed and we reversed, holding that Adams had no standing to bring the action. Adams v. Transamerica, supra, 45 Or. App. at 775, 609 P.2d 834. The case was therefore dismissed without any adjudication on the substantive merits.
Whitt does not argue that this court's determination in Adams v. Transamerica, supra, was on the merits. He merely asserts that plaintiff's theories in the case at bar are based on the same operative facts alleged in plaintiff's counterclaim and cross-claim in the previous action. That is not enough to bring the doctrine of res judicata into play. See Dean v. Exotic Veneers Inc., 271 Or. 188, 531 P.2d 266 (1975); Troutman v. Erlandson, 287 Or. 187, 598 P.2d 1211 (1979); Gittelsohn v. Cannon Beach, 44 Or. App. 247, 605 P.2d 743, rev. den. 289 Or. 71 (1980). Adams v. Transamerica, supra, does not bar plaintiff's instant action for money had and received and restitution, because the prior action did not result in a determination on the merits of the counterclaim or cross-claim.
*942 Whitt's final two assignments may be addressed together. He urges that, inasmuch as he never personally received the $6,875 in question here, he has not "personally benefited" from plaintiff's payment (because he did not get to keep the money) and therefore should not be liable for repayment of that amount. Plaintiff responds that whether Whitt now holds the money is irrelevant, because the record shows that the money was paid by a check made out to both Whitt and Adams and endorsed by both. It further argues that, for restitution to be allowed, it is not necessary that money actually had been paid to Whitt, so long as Whitt received something of value by virtue of the payment.
We agree with plaintiff. There may well be no doubt that, as between Whitt and Adams, Adams should be responsible for repaying plaintiff. However, that is a matter between the two defendants.[7] From plaintiff's point of view, it has parted with $6,875 for which it received no consideration, and Whitt has been discharged in whole or in part of a debt he owes to Adams (or which Adams claims Whitt owes) in a like amount. That is a sufficient benefit to trigger an obligation to repay. The trial court was correct in granting summary judgment against defendant Whitt.
Affirmed.
NOTES
[1]  For the purposes of this opinion, we need not distinguish between the two pleading theories.
[2]  The Workers' Compensation Board declared that the settlement constituted a release prohibited by ORS 656.236.
[3]  The action was dismissed, because Adams lacked standing to sue. Adams v. Transamerica, supra, 45 Or. App. at 775, 609 P.2d 834.
[4]  Attorney fees in workers' compensation cases such as Whitt's are governed by ORS 656.388(1) and OAR 438-82-005 to XXX-XX-XXX. ORS 656.388(1) provides:

"No claim for legal services * * * rendered before a referee or the board * * * in respect to any claim or award for compensation, to or on account of any person, shall be valid unless approved by the board. * * *"
OAR 438-82-170 states:
"A charge for legal services, in respect to any claim or award for compensation, is unenforceable and invalid unless it has been allowed or approved in accordance with 82-170 and ORS Chapter 656."
OAR 438-82-050 speaks of fees paid from a settlement of a disputed claim that is later set aside. According to the rule, when a settlement is set aside, so is the fee, unless the claimant's attorney makes a showing of actual work performed under the provisions of OAR 438-82-005.
[5]  Comment k to § 74, illustrates:

"After the reversal of a judgment any person who, although not a party to the action, was a real party in interest and who received payment in whole or in part as the beneficial owner or as one of several owners, is under a duty to restore the amount received by him."
[6]  The fact that the parties entered into a settlement of the claim does not change this analysis. ORS 656.289(4) requires that any settlement made by the parties be approved by the referee:

"Notwithstanding ORS 656.236, in any case where there is a bona fide dispute over compensability of a claim, the parties may, with the approval of the referee, the board or the court, by agreement make such disposition of the claim as is considered reasonable."
[7]  The defendants' cross-claims on this issue remain to be tried.
