
40 Wn. App. 181 (1985)
697 P.2d 1023
JACK MORITZKY, Respondent,
v.
HENRY S. HEBERLEIN, JR., ET AL, Appellants, WESTERN SURETY COMPANY, Respondent.
No. 6124-8-III.
The Court of Appeals of Washington, Division Three.
April 2, 1985.
Patrick Andreotti, Charles C. Flower, and Flower & Andreotti, for appellants.
John E. Maxwell and Blechschmidt & Maxwell, Inc., P.S., for respondents.
McINTURFF, A.C.J.
Henry and Wendy Heberlein appeal an award of attorney fees to Jack Moritzky, d/b/a Moritzky Construction. We reverse.
In September 1981, Moritzky contracted to frame and roof Heberlein's residence. Construction began immediately. During the course of the work, Moritzky failed to *182 comply with plans and specifications, performed work in a negligent manner, violated several Yakima building codes and did not complete the framing work called for by his contract. Heberlein paid Moritzky for most of his labor, but refused to pay $2,092.93 of "extras" requested by Moritzky.
On January 29, 1982, Moritzky filed a lien for $2,092.93 with the Yakima County Auditor. Three months later, suit was commenced to foreclose the lien. Heberlein answered the suit by counterclaiming for the negligent, incomplete work and the various code violations. Heberlein also asserted a third party complaint against Moritzky's contractor's bond, Western Surety Company.
Following trial, the Superior Court, in its oral opinion: (a) foreclosed Moritzky's lien for the full $2,092.93; (b) awarded Heberlein $4,937 on the counterclaim for negligent and defective work; (c) decided Heberlein's counterclaim was an "independent action" from the lien foreclosure under RCW 60.04, thus no attorney fees and/or costs could be awarded Heberlein; and (d) awarded Moritzky $2,008.80 reasonable attorney fees for the lien foreclosure. It is important to note that the Superior Court expressly held Moritzky's lien judgment would be set off against Heberlein's damages, providing for a net affirmative judgment to Heberlein.
Following a motion for reconsideration, the Superior Court did allow costs to Heberlein as the prevailing party under RCW 4.84.030, but refused to change its ruling on attorney fees under the lien statute, RCW 60.04.130. Heberlein appealed. Both parties request attorney fees on appeal.
Heberlein contends he was the prevailing party under RCW 60.04.130 because of the net affirmative judgment following the setoffs. Moritzky argues that he was the prevailing party on the lien claim since the court foreclosed the entire lien. Moritzky contends the counterclaim was a separate action, and the trial court correctly awarded attorney fees in the manner described above, citing Johnson v. *183 Thompson Constr., 1 Wn. App. 194, 460 P.2d 291 (1969).
Johnson is clearly distinguishable from the present case in that it involved former RCW 60.04.130 which read, in pertinent part:
The court may allow, as part of the costs of the action, the moneys paid for filing or recording the claim, and a reasonable attorney's fee in the superior and supreme courts.
In 1969, RCW 60.04.130 was amended to read:
The court may allow to the prevailing party in the action, whether plaintiff or defendant, as part of the costs of the action, the moneys paid for filing or recording the claim, and a reasonable attorney's fee in the superior and supreme court.
(Italics ours.)
[1] Thus, the disposition of this case turns on the definition of "prevailing party". Determination of which party is the prevailing party, whether for the purpose of awarding costs or attorney fees, is made on the basis of which party has an affirmative judgment rendered in his favor at the conclusion of the entire case. Ennis v. Ring, 56 Wn.2d 465, 353 P.2d 950 (1959); Stott v. Cervantes, 23 Wn. App. 346, 595 P.2d 563 (1979).
The counterclaim asserted by Heberlein for the negligent and incomplete construction was a "compulsory" counterclaim under CR 13(a). Heberlein had to assert such a counterclaim or that claim would be waived forever. 3A L. Orland, Wash. Prac., Rules Practice § 5162 (1980). This action was tried as one lawsuit, and despite the holding that Moritzky was entitled to judgment for the extras sought under the lien, Heberlein received the affirmative net judgment.
The Superior Court erred in awarding attorney fees to Moritzky, and did not exercise its discretion in determining Heberlein's attorney fees. Accordingly, that portion of the judgment awarding attorney fees is reversed; the matter is *184 remanded to determine attorney fees to Heberlein, if any, for the trial and to set attorney fees on the appeal to Heberlein as the prevailing party on appeal.
MUNSON and THOMPSON, JJ., concur.
