
740 P.2d 1320 (1987)
Ronald Q. ELDER, Reed A. Elder, and Alan G. Elder, Plaintiffs and Respondents,
v.
The TRIAX COMPANY, a corporation, Defendant and Appellant.
No. 19420.
Supreme Court of Utah.
July 14, 1987.
Michael E. Talbot, Murray, William L. Nixon, Timothy M. Willardson, Alpine, for defendant and appellant.
Claron C. Spencer, Keith W. Meade, Salt Lake City, for plaintiffs and respondents.
*1321 DURHAM, Justice:
Plaintiffs, prime contractors on a government project, sued defendant, a subcontractor, alleging defendant had breached a contract with plaintiffs. Plaintiffs sought to collect attorney fees as provided by the contract if they prevailed on the merits. Defendant answered by denying liability under the contract and asserted permissive counterclaims arising out of three other contracts between plaintiffs and defendant that were entirely unrelated to the contract under which plaintiffs sued.
In response to plaintiffs' motion for summary judgment, defendant stipulated that it was liable for the principal and interest claimed by plaintiffs. Defendant argued that it could not be liable for attorney fees under the contract until its counterclaims were resolved. The court entered judgment in plaintiffs' favor as to principal and interest, but reserved the issue of the amount of attorney fees. At a later hearing, the court took evidence and then awarded plaintiffs $10,000 in attorney fees, stating that "[t]his judgment is a final judgment as to the remaining issue of attorney fees on the plaintiff's [sic] complaint" pursuant to Utah Rule of Civil Procedure 54(b). This appeal presents us with several issues: whether the district court erred in awarding attorney fees before the counterclaims were resolved; whether the attorney fees award was improper; and whether the district court abused its discretion in certifying the judgment for attorney fees as final under Utah Rule of Civil Procedure 54(b). We affirm.
Defendant cites Nalder v. Kellogg Sales Co., 6 Utah 2d 367, 314 P.2d 350 (1957), and Sugar v. Miller, 6 Utah 2d 433, 315 P.2d 862 (1957), arguing that if a plaintiff sues on a contract or note that provides for an award of attorney fees but the defendant successfully counterclaims, the plaintiff's recovery of attorney fees is precluded or, if the amount of the counterclaim is less than the amount the plaintiff seeks under the contract or note, proportionately diminished; therefore, the amount the defendant owed the plaintiff for attorney fees could not be determined until the counterclaims were decided. We agree with defendant that Nalder and Sugar embody correct statements of law. We think, however, that an examination of the logic and history of the rule stated in Sugar and Nalder demonstrates that the rule should not be applied in cases in which the counterclaims arise out of transactions totally unrelated to the note or contract pursuant to which the party seeks attorney fees. The rationale underlying the rule is that
the holder of the note being indebted to the defendant maker in a greater amount than the sum due on the note, the note is substantially paid, or, if the setoff or counterclaim allowed is in a sum smaller than the amount due on the note, then the note has been proportionately paid.
41 A.L.R.2d 677, 678 (1955).
We are aware that the rule is frequently recited and even applied on occasion without distinction between counterclaims arising and counterclaims not arising out of the same transaction. We agree, however, with the phrasing and application of the rule recently stated by the Colorado Appellate Court: "[W]e hold that the contractor is not entitled to a judgment for attorney fees or interest under the applicable contract provision when the owners obtained a judgment on their counterclaim arising out of the same transaction that is greater than the amount of judgment in favor of the contractor." Wagonmaster, Inc. v. Parrot, 713 P.2d 417, 418 (Colo. App. 1985) (emphasis added).
The foregoing language from Wagonmaster is in keeping with the inferences that can be drawn from other authority. We note that in Pioneer Constructors v. Symes, 77 Ariz. 107, 267 P.2d 740 (1954), the lead case for the general rule, the debtor counterclaimed for lack of consideration, overcharge, fraud, and misrepresentation, claims arising out of the same transaction in which his note was executed. See also Dooling v. Casey, 152 Mont. 267, 273-74, 448 P.2d 749, 756-57 (1968) (following Nalder in denying attorney fees to creditor who counterclaimed for payment on note which financed the contract debtors claimed creditor breached); Morgan v. *1322 Young, 203 S.W.2d 837, 858 (Tex.Civ.App. 1947) (counterclaim arose out of breach of a contract that was entered into in conjunction with an extension of the time the debtor had to pay the note upon which the plaintiff sued). Our own case, Sugar v. Miller, is a good illustration of when the general rule should logically apply. In Sugar, the plaintiff contracted with the defendant, a printer, for the printing of offering circulars and stock certificates. The plaintiff gave his personal guarantee that he would pay for the documents. When the defendant later demanded payment, the plaintiff explained that he did not have the cash. The plaintiff and the defendant then went to the plaintiff's bank, where they signed a note for $2,000 on the proceeds of the note to pay for the printing, and the plaintiff repaid the bank. The plaintiff then sued the defendant, alleging that as cosigner, the defendant owed the note. The defendant admitted liability on the note and counterclaimed for the balance remaining on the printing contract. It would have been manifestly unfair for the court to have imposed attorney fees on the defendant because the defendant's counterclaim amounted to an assertion that he did not really owe the plaintiff anything on the note, which was signed only to facilitate the plaintiff's payment of the defendant under the printing contract.
Early statements of the general rule do not carefully distinguish between counterclaims that arise out of the same transaction and counterclaims that do not because those claims that we now denominate permissive counterclaims used to be available only under a narrow range of circumstances and because the vocabulary of early courts and commentators was imprecise. At common law, a counterclaim arising out of the same transaction was called a "recoupment" and was asserted only to diminish the plaintiff's affirmative claim; it did not serve as a basis for affirmative relief. By contrast, setoffs were based on unrelated claims and served as sources of affirmative relief. Setoffs, however, were allowed only for liquidated amounts or claims arising from a contract or judgment. See Wright & Miller, Federal Practice and Procedure § 1401 (1971). Early pleading rules required that "counterclaims" arise out of the same transaction and diminish or destroy the affirmative claim in some way, but the pleading rules eliminated the restriction on setoffs, thus making counterclaims into expanded recoupment actions. The terms were often used imprecisely. For example, the paragraph from the A.L.R. article quoted earlier speaks of "setoffs" being considered as payment on the note, a rationale which makes sense in terms of "recoupment," which at common law served to diminish or destroy the existence of the plaintiff's affirmative claim or a counterclaim setoff under some pleading codes, but makes no sense in terms of the concept of setoff at common law.
Aside from the historical analysis, it is difficult to justify a rule under which defendant could defeat plaintiffs' right to attorney fees under a contract or note by selecting the action on the note as the forum for the resolution of its unrelated counterclaims. In short, under defendant's argument, if it had sued on the counterclaims earlier, later, or in a different forum, plaintiffs' right to collect attorney fees under the contract would have remained unimpaired, but it should be permitted to change this result merely by using the permissive counterclaims defensively. We do not agree, and we affirm the trial judge's award of attorney fees before the resolution of the counterclaims.
Defendant argues that the trial court acted improperly because it awarded plaintiffs fees for time their attorney spent defending the counterclaims and awarded an excessive amount for fees. We have reviewed the record, which indicates that plaintiffs' attorney testified that the hours for which fees were awarded were spent pursuing the collection action and not responding to the counterclaims. This testimony went unchallenged and supports the trial judge's conclusion. The reasonableness of the attorney fees award is also well documented by the record, which contains detailed documentary evidence supporting the testimony of plaintiffs' attorney.
*1323 We also reject defendant's claim that the trial court erred in entering final judgment on the attorney fees issue under Utah Rule of Civil Procedure 54(b). Rule 54(b) provides:
When more than one claim for relief is presented in an action, whether as a claim, counterclaim, cross-claim, or third-party claim, and/or when multiple parties are involved, the court may direct the entry of a final judgment as to one or more but fewer than all of the claims or parties only upon an express determination by the court that there is no just reason for delay and upon an express direction for the entry of judgment. In the absence of such determination and direction, any order or other form of decision, however designated, which adjudicates fewer than all the claims or the rights and liabilities of fewer than all the parties shall not terminate the action as to any of the claims or parties, and the order or other form of decision is subject to revision at any time before the entry of judgment adjudicating all the claims and the rights and liabilities of all the parties.
See also Pate v. Marathon Steel Co., 692 P.2d 765 (Utah 1984).
Defendant argues that the trial court did not make an express determination that there was no just reason for delay. We disagree. The trial court determined that because defendant had already paid plaintiffs the amount due under the contract with interest, there was no reason not to make the attorney fees award final and thus dispose of the entirety of plaintiffs' claim against defendant. The court stated: "This judgment is a final judgment as to the remaining issue of attorney fees on plaintiff's [sic] complaint, the court having determined that there is no just reason for delay, particularly in the light of the defendant's payment of the amount of plaintiff's [sic] claim."
This finding satisfies Rule 54(b).
The judgment of the trial court is affirmed.
STEWART, Associate C.J., and ZIMMERMAN, J., concur.
HOWE, Justice (dissenting).
I dissent. I would delay the award of attorney fees until after the adjudication of defendant's counterclaims. I cannot subscribe to the restriction adopted by the majority that a plaintiff's contractual right to attorney fees can only be defeated by successful counterclaims which arise out of the same transaction. The only authority cited by the majority which adopts such a restriction is Wagonmaster, Inc. v. Parrot, 713 P.2d 417 (Colo. App. 1985). The issue of imposing such a restriction was not raised or adjudicated in that case. The restriction was merely recited in the court's statement of its rule. None of the cases cited by the Colorado court in support of its decision impose the restriction in stating the rule denying fees. Neither do any of the cases cited by the majority. While in some cases, such as those cited by the majority, the counterclaim did arise out of the same transaction, in other cases it did not. Wagner v. Chisholm, 246 S.W. 1044 (Tex.Civ. App. 1923); Morgan v. Virginia-Carolina Chemical Co., 213 Ala. 551, 106 So. 136 (1925).
Our cases of Sugar v. Miller, 6 Utah 2d 433, 315 P.2d 862 (1957), and Nalder v. Kellogg Sales Co., 6 Utah 2d 367, 314 P.2d 350 (1957), do not restrict the rule denying attorney fees to cases where the defendant's counterclaim arises out of the same transaction as the contract or note upon which the plaintiff brings suit. While there may be certain types of counterclaims which a defendant might interpose which should not defeat a plaintiff's right to attorney fees, the restriction adopted by the majority is much too limiting. The instant case is a prime example of where all of the claims of the two parties should be adjudicated before attorney fees are awarded to either side. Both plaintiffs and defendant are engaged in the construction business. Over a short period of time, they entered into three separate contracts with each other, all of which involved construction at military bases of the United States government. One was in Alaska, one in Montana, and one on the island of Midway. *1324 Plaintiffs brought suit to recover a balance owing on the Alaska contract. Defendant counterclaimed for amounts allegedly owing to it on the Montana and Midway contracts. It makes eminent sense to me to delay the award of attorney fees on all of the contracts until the conflicting claims of the parties arising from their contracts have been resolved. When that resolution has been made, an appropriate attorney fee can be awarded to the party who emerges from the suit with a net judgment. This practice accords with the reasoning of this Court in Sugar v. Miller that a note or contract is paid when the holder of the note is indebted to the maker in a greater amount than the sum due on the note. See the annotation at 41 A.L.R.2d 677, where numerous cases are cited in support of the rule without the restriction adopted by the majority.
Under the restriction adopted by the majority, the maker of a note or the obligor in a contract would be compelled to pay any balance owing, even though he may hold a valid counterclaim arising from a course of dealing between the parties. This may be grossly unjust in cases where the prospect for later collection of any recovery on the counterclaim is dubious. Under the restrictive rule adopted by the majority, the payee of a promissory note or the obligee of a contract, instead of endeavoring to negotiate settlement of any claims of the maker or obligor, will be well-advised to immediately file suit on the note or contract when it falls due so as to become entitled to attorney fees as a hedge against the defendant's potential counterclaim.
In addition to the foregoing argument, the contractual language used by the parties in the instant case would seem to preclude the award of attorney fees to either party until the suit has been concluded. The contract sued upon by plaintiffs contained the following provision:
In the event either contractor or subcontractor institutes suit in court against the other party or against the surety of such party, in connection with any dispute or matter arising under this agreement, the party which prevails in that suit shall be entitled to recover from the other its attorney fees in reasonable amount... .
(Emphasis added.) Thus, the parties by their express agreement have made attorney fees determinative upon one or the other prevailing in the suit. A "suit" embraces claims stated in the complaint and in the counterclaim. In an annotation at 66 A.L.R.3d 1115, dealing with the award of costs to the "prevailing party," it is stated that "courts have generally expressed the view that costs should be awarded to the party in whose favor the final judgment was entered." Id. at 1118-19. The same rule should be followed with regard to the award of attorney fees to the "prevailing party." Had the parties to this action intended by their contractual language that attorney fees should be awarded strictly on the basis as to which party prevailed on claims arising from the contract sued upon by plaintiffs, they could have used appropriate contractual language to achieve that result. See Highland Construction Co. v. Stevenson, 636 P.2d 1034 (Utah 1981), discussing Utah Code Ann. § 14-1-8 (1953), which provides for the award of attorney fees to "the prevailing party, upon each separate cause of action."[1] (Emphasis added.) No such restrictive language was used by the contracting parties in the instant case, and I would withhold the award of any attorney fees until the litigation between them which arises out of the course of their business dealings has been finally determined. At that time, an award of attorney fees can be made to the "prevailing party," which will be the party emerging with the net judgment.
HALL, C.J., concurs in the dissenting opinion of HOWE, J.
NOTES
[1]  Sections 14-1-5 to -12 were repealed by 1980 Utah Laws ch. 75, § 5.
