*338 Opinion
Defendant Richard K. Dintino appeals a judgment entered in favor of plaintiff IndyMac Bank, F.S.B. (Bank), in its action against him arising out of his nonpayment of a home loan. 1 The trial court granted Dintino’s motion for summary adjudication of Bank’s breach of contract cause of action, but denied his motion for summary adjudication of Bank’s causes of action for unjust enrichment and money lent. The parties then stipulated to a bench trial on their briefs on the sole issue of the amount of damages due Bank on its unjust enrichment cause of action. The court entered judgment for Bank in the amount of $268,177.61, plus prejudgment interest of $147,007.30. The court subsequently denied Dintino’s motion for an award of attorney fees he incurred in defending against Bank’s breach of contract cause of action.
On appeal, Dintino contends the trial court erred by denying (1) his motion for summary adjudication of Bank’s unjust enrichment cause of action because it is barred by the Code of Civil Procedure 2 section 338, subdivision (d), three-year statute of limitations; (2) his motion for summary adjudication of Bank’s money lent cause of action because it, together with Bank’s breach of contract cause of action, is barred pursuant to the one-action rule of section 726; (3) his motion for summary judgment based on his affirmative defense of unclean hands; and (4) his motion for an award of attorney fees incurred in defending against Bank’s breach of contract cause of action.
*339 FACTUAL AND PROCEDURAL BACKGROUND
On or about June 11, 1999, Dintino borrowed $270,400 from ICON Mortgage, Inc. (ICON), to fund his purchase of residential real property located at 4755 Panorama Drive, San Diego (Property). The loan was evidenced by Dintino’s execution of a note in that amount (Note). The Note was secured by a deed of trust (Tmst Deed) on the Property. The Tmst Deed was executed by Dintino on June 15 and recorded with the San Diego County Recorder on June 18. On or about June 16, ICON executed a corporation assignment of deed of tmst (Assignment), transferring all of its beneficial interest in the Tmst Deed (and presumably the Note) to INMC Mortgage Holdings, Inc. (predecessor in interest to Bank). On December 9, the Assignment was recorded with the San Diego County Recorder.
On July 23, 1999, Bank transferred all of its interest in the Note to WAMU Mortgage Securities Corp. (WAMU). 3 On December 6, pursuant to Bank’s request, T.D. Service Company, successor trastee of the Tmst Deed (Trastee), executed a full reconveyance (Reconveyance) of its interest in the Tmst Deed. On December 9, the Reconveyance was recorded with the San Diego County Recorder.
On or about August 18, 2000, Dintino executed a grant deed (Grant Deed) transferring the Property to Paul L. Strieker. On August 30, the Grant Deed was recorded with the San Diego County Recorder. However, on Dintino’s sale of the Property to Strieker, none of the sale proceeds were used to pay the unpaid principal balance of the Note (i.e., $268,177.61). Instead, all of the net proceeds from the sale were paid to Dintino.
After paying all prior monthly installments on the Note, Dintino did not pay the monthly installment due on September 1, 2000, which installment was subject to a late charge if not paid by September 15. 4 Prior to that September installment, Dintino had paid all monthly installments between seven and 18 days after their respective due dates. After August 2000, Dintino did not pay any further installments on the Note. On or about October 24, WAMU apparently received a letter from Dintino informing it of his sale of the Property. 5 Bank apparently received a copy of that letter on *340 October 25. In or about May 2003, Bank repurchased the Note from WAMU in response to WAMU’s demand based on the absence of a first lien position trust deed.
On September 5, 2003, Bank filed the instant action against Dintino alleging causes of action for (1) breach of contract; (2) money lent; and (3) unjust enrichment. Dintino filed an answer, asserting the affirmative defenses that Bank’s claims were barred by (1) applicable statutes of limitations (e.g., §§ 337, 338 & 339); (2) the antideficiency statutes, including the one-action rule (§§ 580 et seq., 726); and (3) the doctrine of unclean hands.
In March 2006, Bank and Dintino each filed a motion for summary judgment or, in the alternative, summary adjudication. Dintino argued there were no triable issues of material fact regarding (1) his section 726 one-action rule defense to Bank’s causes of action for breach of contract and money lent; and (2) his statute of limitations defense to Bank’s cause of action for unjust enrichment. Bank argued there were no triable issues of material fact regarding all three of its causes of action and that it therefore was entitled to judgment as a matter of law or, at least, summary adjudication on some of its causes of action.
On September 11, the trial court issued a minute order denying Bank’s motion and granting, in part, Dintino’s motion. The order stated:
“[Bank’s] Motion for Summary Judgment is denied. [Bank has] not carried [its] initial burden of proof to show by admissible evidence entitlement to recovery on each cause of action pled. The One Action Rule, [§] 726, bars [Bank] from recovering on an action on the [Note] as [a] matter of law. . . . [Bank’s] alternative Motion for Summary Adjudication of Issues ... is also denied. The [cause of action] on the [Note] is barred by application of the One Action Rule. Material issues of fact remain on the causes of action for money lent and unjust enrichment as to the amount of damages. It is a disputed question of fact whether the damages suffered by [Bank] are those argued by [Bank] to be $374,459.26. . . .
“[Dintino’s] Motion for Summary Judgment is denied pursuant to [§] 437c[, subd.] (p)(2) as he has not shown any affirmative defense to the [Bank’s] cause of action for money lent or unjust enrichment. [Citations.] Unclean hands does not apply because he who would seek equity must do equity and it is undisputed [Dintino] never paid off the loan. . . . [Dintino’s] legal affirmative defense that a three year Statute of Limitations bars the cause of *341 action for unjust enrichment is not applicable. The applicable Statute of Limitations is four (4) years because this action arises out of a written contract. [§] 337. Moreover, even if a three (3) year, statute could be said to apply, it would not begin to run until [Bank] discovered the fraud or mistake leading to the unjust enrichment, i.e.[,] that Dintino had received proceeds from the sale of the [Property and would not repay the Note. The Bank did not learn of the sale of the [Property until at the earliest 10/25/00. Further, the Bank could not know Dintino was not going to make the 9/00 payment until at least 9/15/00, when such payment would be late.
“[Dintino’s] alternative Motion for Summary Adjudication of Issues is granted as to the cause of action on the [Note] for the reasons stated above, but is denied as to the causes of action for money lent and unjust enrichment. A party benefiting from a mistake of another, in this case [Bank’s] reconveyance of a Deed of Trust, is not entitled to retain what amounts to a windfall. [Citation.] The amount of any such windfall remains to be determined.”
On October 31, the parties filed with the trial court their stipulation for a bench trial by briefs (Stipulation), which stated in part:
“2. WHEREAS, absent an indication to the contrary by the Court, the Parties read the [trial court’s summary judgment motion] Ruling to restrict the sole issue at trial to be the ‘amount of damages’ sustained by [Bank] on its claim for unjust enrichment, and that no other evidence is relevant at trial.
“3. WHEREAS the Parties stipulate for the purpose of this trial that: [<j[] . . . [j[] (d) The unpaid principal balance of the Loan to [Dintino] was $268,177.61 as of September of 2000; [j[] (e) Lawyers Title Company [presumably the escrow holder] paid none of this unpaid principal balance to [Bank] in connection with the close of escrow on August 30, 2000 on the sale of the Property, [f] The net proceeds of the sale of the Property (after payment by Lawyers Title Company of settlement charges, existing mortgages and taxes) were distributed to Dintino.
“4. WHEREAS, without waiver of any rights to appeal or otherwise seek review of the Court’s [summary judgment motion] Ruling, the Parties stipulate and agree that the trial of this action may be based upon written briefs, upon the agreed-upon facts as stipulated herein. The Parties further stipulate and agree that the written briefs that will be submitted shall solely address the amount of damages sustained by [Bank] on its claim for unjust enrichment. . . . fi[] . . . [f] The parties will seek clarification from the Court whether the ‘amount of damages’ determination will encompass something other than the unpaid principal.
*342 “5. WHEREAS, notwithstanding the foregoing, the Parties specifically reserve all rights to appeal or otherwise seek review of the Court’s [summary judgment motion] Ruling, as well as any judgment entered following the trial of this action.” (Italics added.)
On February 14, 2007, following submission by the parties of their trial briefs, the trial court entered judgment in favor of Bank in the amount of $268,177.61 principal, plus $147,007.30 in prejudgment interest.
On August 13, Dintino filed a motion requesting an award of attorney fees he incurred in defending against Bank’s breach of contract cause of action, arguing he was entitled to those fees under Civil Code section 1717 as the prevailing party on Bank’s only cause of action based on the Note (i.e., its breach of contract claim), which contained an attorney fees provision. On October 12, the trial court denied Dintino’s motion, explaining Bank “achieved its main litigation objectives.”
Dintino timely filed a notice of appeal.
DISCUSSION
I
Denial of Dintino’s Motion for Summary Adjudication of Bank’s Unjust Enrichment Cause of Action
Dintino contends the trial court erred by denying his motion for summary adjudication of Bank’s cause of action for unjust enrichment based on his affirmative defense of the statute of limitations. He argues the court erred by applying the section 337 four-year statute of limitations rather than the section 338 three-year statute of limitations and by concluding that, even if the three-year statute applied, Bank’s complaint was timely filed.
A
We first address Bank’s argument that Dintino cannot challenge on appeal the trial court’s decision denying his motion for summary adjudication of its unjust enrichment cause of action. Citing
Sierra Craft, Inc.
v.
Magnum Enterprises, Inc.
(1998)
An order denying a motion for summary judgment or summary adjudication is not an appealable order. (§ 904.1;
Lackner
v.
LaCroix
(1979)
In the circumstances of this case, the trial court denied Dintino’s motion for summary adjudication of Bank’s cause of action for unjust enrichment based on his statute of limitations defense. However, because the trial court did
not
decide that same question (i.e., applicability of the statute of limitations defense) after the trial on the parties’ briefs, Dintino can challenge the court’s order denying his summary adjudication motion on appeal from the judgment entered by the court after trial. We note the
only
question the parties posed (by stipulation) for the trial court’s determination at trial was “the amount of damages sustained by [Bank] on its claim for unjust enrichment.” The court did not address any factual or legal question regarding the applicability of a statute of limitations defense to Bank’s unjust enrichment cause of action. (Cf.
Gackstetter v. Frawley, supra,
135 Cal.App.4th at pp. 1268-1270, 1279;
Schmidlin v. City of Palo Alto
(2007)
*344
Although
Sierra Craft
concluded an order denying a summary judgment motion “may only be reviewed by way of a petition for extraordinary writ”
(Sierra Craft, supra,
B
A trial court’s order granting or denying a motion for summary adjudication is reviewed de novo.
(Ojavan Investors, Inc. v. California Coastal Com.
(1997)
*345
“On appeal after a motion for summary judgment [or summary adjudication] has been granted [or denied], we review the record de novo, considering all the evidence set forth in the moving and opposition papers except that to which objections have been made and sustained. [Citation.]”
(Guz
v.
Bechtel National, Inc.
(2000)
Aguilar
clarified the standards that apply to summary judgment motions under section 437c.
(Aguilar, supra,
25 Cal.4th at pp. 843-857.) Generally, if all the papers submitted by the parties show there is no triable issue of material fact and the “moving party is entitled to a judgment as a matter of law” (§ 437c, subd. (c)), the court must grant the motion for summary judgment.
(Aguilar,
at p. 843.) Section 437c, subdivision (o), provides a cause of action has no merit if (1) one or more elements of that cause of action cannot separately be established; or (2) a defendant establishes an affirmative defense to that cause of action. Section 437c, subdivision (p)(2), states: “A defendant or cross-defendant has met his or her burden of showing that a cause of action has no merit if that party has shown that one or more elements of the cause of action . . . cannot be established, or that there is a complete defense to that cause of action. Once the defendant or cross-defendant has met that burden, the burden shifts to the plaintiff or cross-complainant to show that a triable issue of one or more material facts exists as to that cause of action or a defense thereto. The plaintiff or cross-complainant may not rely upon the mere allegations or denials of its pleadings to show that a triable issue of material fact exists but, instead, shall set forth the specific facts showing that a triable issue of material fact exists as to that cause of action or a defense thereto.”
Aguilar
stated: “To speak broadly, all of the foregoing discussion of summary judgment law in this state, like that of its federal counterpart, may be reduced to, and justified by, a single proposition:
If a party moving for summary judgment in any action . . . would prevail at trial without submission of any issue of material fact to a trier of fact for determination, then he should prevail on summary judgment.
In such a case, ... the ‘court should grant’ the motion ‘and avoid a . . . trial’ rendered ‘useless’ by nonsuit or directed verdict or similar device. [Citations.]” (
*346
“On appeal, we exercise ‘an independent assessment of the correctness of the trial court’s ruling, applying the same legal standard as the trial court in determining whether there are any genuine issues of material fact or whether the moving party is entitled to judgment as a matter of law.’ [Citation.] ‘The appellate court must examine only papers before the trial court when it considered the motion, and not documents filed later. [Citation.] Moreover, we construe the moving party’s affidavits strictly, construe the opponent’s affidavits liberally, and resolve doubts about the propriety of granting the motion in favor of the party opposing it.’ [Citations.]”
(Seo v. All-Makes Overhead Doors
(2002)
C
Dintino asserts the trial court erred by concluding section 337’s four-year statute of limitations applied to Bank’s cause of action for unjust enrichment. Section 337 provides a four-year statute of limitations for “[a]n action upon any contract, obligation or liability founded upon an instrument in writing.” In denying Dintino’s motion for summary adjudication, the trial court stated: “[Dintino’s] legal affirmative defense that a three year Statute of Limitations bars the cause of action for unjust enrichment is not applicable. The applicable Statute of Limitations is four (4) years because this action arises out of a written contract. [§] 337.” However, a cause of action for unjust enrichment is
not
based on, and does not otherwise arise out of, a written contract. Rather, unjust enrichment is a common law obligation implied by law based on the equities of a particular case and not on any contractual obligation.
(McBride
v.
Boughton
(2004)
“[A]n individual may be required to make restitution if he is unjustly enriched at the expense of another. [Citation.] A person is enriched if he receives a benefit at another’s expense. [Citation.] The term ‘benefit’ ‘denotes any form of advantage.’ [Citation.] Thus, a benefit is conferred not only when
*347
one adds to the property of another, but also when one saves the other from expense or loss. Even when a person has received a benefit from another, he is required to make restitution ‘only if the circumstances of its receipt or retention are such that, as between the two persons, it is unjust for him to retain it.’ [Citation.] [][] Thus, a party who does not know about another’s mistake, and has no reason to suspect it, may not be required to give up the benefit if he also relied on it to his detriment. . . . [][] In other circumstances, however,
the party benefiting from a mistake of fact may . . . not be entitled to retain what amounts to a mere
windfall.”
(Ghirardo v. Antonioli
(1996)
Bank’s cause of action for unjust enrichment based on its mistaken request for recordation of the Reconveyance is not based on, and does not arise out of, a written contract (i.e., the Note), but rather is based on an obligation implied by law because of the equities in the circumstances of this case. Furthermore, were the section 337 “written contract” limitations statute to apply, it would, as Dintino argues, necessarily be inconsistent with the trial court’s conclusion that the section 726 one-action rule precluded an action on the Note. Accordingly, the four-year statute of limitations under section 337 does not apply to bar Bank’s unjust enrichment cause of action.
D
However, the trial court alternatively concluded that if the section 338 three-year statute of limitations were to apply, Bank’s unjust enrichment cause of action nevertheless would have been timely because Bank did not discover its mistake and that Dintino would not repay the loan until a date no earlier than September 15, 2000.
We agree with Dintino that the applicable statute of limitations is section 338, subdivision (d), which provides a three-year limitations period for “[a]n action for relief on the ground of fraud or mistake.” (Italics added.) That subdivision further provides: “The cause of action in that case is not deemed to have accrued until the discovery, by the aggrieved party, of the facts constituting the fraud or mistake.” (§ 338, subd. (d).) In denying Dintino’s motion for summary adjudication of Bank’s unjust enrichment cause of action, the trial court stated: “[E]ven if a three (3) year statute [i.e., § 338, subd. (d)] could be said to apply, it would not begin to run until [Bank] discovered the fraud or mistake leading to the unjust enrichment, i.e.[,] that Dintino had received proceeds from the sale of the [Property and would not repay the Note. The Bank did not learn of the sale of the [Property until at the earliest 10/25/00. Further, the Bank could not know *348 Dintino was not going to make the 9/00 payment until at least 9/15/00, when such payment would be late.”
We conclude the section 338, subdivision (d), three-year statute of limitations applies to an unjust enrichment cause of action based on
mistake.
Bank’s cause of action for unjust enrichment was based on its
mistaken
request for recordation of the Reconveyance, which resulted in loss of its security interest in the Property (i.e., the Trust Deed) and its ability to foreclose on the Trust Deed in the event of a default on the Note. An unjust enrichment or quasi-contract action in the form of a common count to recover money or other benefit obtained by mistake is governed by the three-year statute of limitations for actions based on fraud or mistake (i.e., § 338, subd. (d)).
(First Nationwide Savings v. Perry
(1992)
E
Although we agree with Dintino that the section 338 three-year statute of limitations applies to Bank’s unjust enrichment cause of action, we disagree with his assertion that the “discovery rule” does not apply to delay the accrual, or “running,” of that three-year period until Bank discovered, or reasonably should have discovered, its mistake and Dintino’s alleged unjust enrichment that provided the basis for its cause of action against him. Citing
Shively v. Bozanich
(2003)
Shively
addressed “the application of the statute of limitations for defamation, which requires that an action be filed within one year of accrual of the cause of action, to the present case. ([§ 340, subd. (c).])”
6
(Shively, supra,
Assuming arguendo
Shively’s
holding supports a general rule that in defamation and other cases the discovery rule does not apply when the basis for a cause of action is contained in information accessible to the general public (e.g., public record), we nevertheless conclude that holding does
not
apply to a cause of action subject to a limitations period under section 338, subdivision (d). The California Supreme Court noted a few years before
Shively:
“An exception to the general rule for defining the accrual of a cause of action ... is
the discovery rule.
[Citation.] It
may be expressed by the Legislature or implied by the courts.
[Citation.] It postpones accrual of a cause of action until the plaintiff discovers, or has reason to discover, the
*350
cause of action. [Citations.]”
(Norgart v. Upjohn Co.
(1999)
F
Because the discovery rule applies to Bank’s unjust enrichment cause of action based on its mistaken request for recordation of the Reconveyance, we address the question of when that cause of action began to accrue under the discovery rule. We must determine when Bank actually, or reasonably should have, discovered its mistake that resulted in the unjust enrichment of Dintino.
“[T]he plaintiff discovers the cause of action when he at least suspects a factual basis, as opposed to a legal theory, for its elements, even if he lacks knowledge thereof—when, simply put, he at least ‘suspects . . . that someone has done something wrong’ to him [citation], ‘wrong’ being used, not in any technical sense, but rather in accordance with its ‘lay understanding’ [citation]. He has reason to discover the cause of action when he has reason at least to suspect a factual basis for its elements. [Citation.] He has reason to suspect when he has ‘ “ ‘ “notice or information of circumstances to put a reasonable person
on
inquiry” ’ ” ’ [citation]; he need not know the ‘specific “facts” necessary to establish’ the cause of action; rather, he may seek to learn such facts through the ‘process contemplated by pretrial discovery’; but, within the applicable limitations period, he must indeed seek to learn the facts necessary to bring the cause of action in the first place—he ‘cannot wait for’ them ‘to find’ him and ‘sit on’ his ‘rights’; he ‘must go find’ them himself if he can and ‘file suit’ if he does [citation].”
(Norgart v. Upjohn Co., supra, 21
Cal.4th at pp. 397-398, fns. omitted, quoting
Jolly
v.
Eli Lilly & Co.
(1988)
*351 Applying the above standard to the undisputed facts in this case, we conclude Bank did not discover, and should not have reasonably discovered, its unjust enrichment cause of action until, at the earliest, September 15, 2000, when Dintino’s September installment became subject to a late charge. Dintino was unjustly enriched as early as December 9, 1999, when the Reconveyance was recorded per Bank’s mistaken request. Because the effect of the Reconveyance was to eliminate Bank’s Trust Deed lien on the Property as security for the Note, Dintino thereafter was free to either encumber or sell the Property without regard to the Bank’s Trust Deed interest. That ability to obtain money from the encumbrance or sale of the Property effectively enriched Dintino as of December 9. As of that date Dintino’s “equity” in the Property greatly increased (i.e., presumably by almost $270,000), thereby “enriching” him to that extent. Therefore, we conclude Dintino was unjustly enriched as of December 9. The fact that he did not actually obtain money from, or “liquidate,” that increased equity until August 30, 2000, when he sold the Property and obtained the sale proceeds, does not change our conclusion.
Although Dintino asserts that the parties stipulated, and the trial court found, Dintino was unjustly enriched as of August 30, 2000, the record does not support that assertion. In fact, the only reference to August 30, 2000, in the Stipulation was the parties’ stipulation for purposes of the trial that: “Lawyers Title Company paid none of this unpaid principal balance to plaintiff in connection with the close of escrow on August 30, 2000 on the sale of the Property.” Furthermore, neither the trial court’s order on the parties’ summary judgment motions nor the judgment after trial stated the finding asserted by Dintino. Although the judgment calculated prejudgment interest from September 1, 2000, that date presumably was chosen by the trial court because that was the due date of the first monthly installment on the Note that Dintino did not pay. Dintino correctly notes the trial court’s minute order following the trial on the briefs stated the parties stipulated that Dintino was unjustly enriched on August 30, 2000, when he wrongly retained the proceeds from the sale of the Property rather than paying off the Note. However, because the Stipulation did not so provide, we do not defer to the trial court’s statement in that regard. In any event, assuming Dintino’s unjust enrichment occurred on August 30, 2000, based on our discussion below, we nevertheless conclude Bank did not discover, and reasonably should not have discovered, the facts underlying its unjust enrichment cause of action based on its mistake until September 15, 2000, at the earliest. To the extent Dintino cites
First Nationwide Savings v. Perry, supra,
Although Dintino was unjustly enriched as of December 9, 1999, because of Bank’s mistaken request for recordation of the Reconveyance, application of the discovery rule to the undisputed facts in this case shows that Bank’s cause of action for unjust enrichment did not begin to accrue until September 15, 2000, at the earliest. Dintino argues Bank should have been charged with notice of its cause of action when there were public records that effectively disclosed Dintino’s unjust enrichment (e.g., the December 9, 1999, recordation of the Reconveyance or, at the latest, the August 30, 2000, recordation of the Grant Deed on sale of the Property). He argues a reasonable person should have suspected he may have been unjustly enriched, and had a duty to investigate, on the recordation of either the Reconveyance or the Grant Deed. However, there is no logical reason to charge a reasonable person in Bank’s position with a duty to investigate based solely on the mistake that resulted in Dintino’s alleged unjust enrichment. Bank’s mistake was its mistaken request that the Trust Deed Trustee record the Reconveyance. To charge Bank with knowledge of that mistake would be inherently inconsistent with the fundamental reasoning for an equitable cause of action for unjust enrichment based on mistake. (Cf.
Tarke v. Bingham
(1898)
Similarly, in this case, although the public records of the San Diego County Recorder were open and available to Bank, there was no duty imposed on it, based solely on its mistake, to review those records and discover the Reconveyance it had mistakenly requested. That mistake, by itself, was insufficient to make a reasonable person suspicious that he or she may have a cause of action and therefore to impose a duty to investigate. Rather, there must be some separate (e.g., future) occurrence of which Bank, *353 as a reasonable entity, should be charged with knowledge that would reasonably cause it to suspect it may have a cause of action for unjust enrichment based on mistake.
In this case, we further conclude the August 30, 2000, recordation of the Grant Deed pursuant to which Dintino sold the Property was likewise insufficient to charge Bank, or a reasonable person, with knowledge of information causing it to suspect it may have a cause of action for unjust enrichment based on mistake. Because the Reconveyance was recorded on December 9, 1999, thereby eliminating Bank’s Trust Deed lien on the Property, Bank was not given any notice by the escrow holder (or by Dintino or Strieker) of the sale of the Property.
Had
the Reconveyance
not
been recorded and the Trust Deed remained in effect in the public records, Bank presumably would have been notified by the escrow holder of the pending sale by a request for the amount required to fully pay the Note secured by the Trust Deed. However, in the circumstances of this case, no request or other notice was given to Bank that would have charged it with information regarding the sale and/or Dintino’s possible unjust enrichment. Absent notice, we decline to impose on Bank a duty to continually monitor all public records to determine whether it may have a cause of action against Dintino (or any other borrower) for unjust enrichment based on mistake. (Cf.
Gryczman
v.
4550 Pico Partners, Ltd.
(2003)
In the circumstances of this case, the first information Bank received that reasonably could have put it on notice of information causing it to suspect Dintino had been unjustly enriched based on its mistake, and thereby charging it with a duty to investigate further, was the failure by Dintino to timely pay his September 2000 installment on the Note before a late charge would apply (i.e., Sept. 15, 2000). Although at that time Dintino’s installments were payable to WAMU, Bank, as subsequent transferee of the Note, presumably took the Note subject to WAMU’s knowledge, whether actual or presumed. In this case, WAMU could not have reasonably known Dintino might not pay the September 2000 installment until September 15, when a late charge applied. Prior to September 2000, Dintino had paid all monthly installments between seven and 18 days after their respective due dates. In *354 fact, Dintino continued to pay all monthly installments on the Note after the Reconveyance was recorded on December 9, 1999, leading Bank (and presumably WAMU) to believe he would continue to pay all monthly installments on the Note until paid in full, despite the recordation of the Reconveyance. There was nothing unusual in the fact that Dintino did not pay his September 2000 installment on or before September 1, its technical “due date.” On the contrary, the first unusual occurrence that would give Bank (or WAMU) information that there may be a problem with Dintino’s payment of the Note was September 15, 2000, when he did not pay the September installment before a late charge was imposed. Accordingly, there was no occurrence before September 15, 2000, that would lead Bank (or WAMU) to suspect Dintino would not continue to pay all installments on the Note and, thus, that Bank may have an unjust enrichment cause of action based on mistake. On September 15, 2000, at the earliest, Bank therefore was charged with information that would cause it to suspect it had such a cause of action and require it to investigate the matter (and thereby learn of its mistake in requesting recordation of the Reconveyance). Accordingly, based on our application of the discovery rule to the undisputed facts in this case, we conclude, as a matter of law, that Bank’s unjust enrichment cause of action based on mistake did not begin to accrue until September 15, 2000, at the earliest. Because Bank filed its complaint on September 5, 2003, its unjust enrichment cause of action was timely asserted within the applicable three-year statute of limitations. (§ 338, subd. (d).) Therefore, in denying Dintino’s motion for summary judgment and summary adjudication, the trial court correctly concluded Bank’s unjust enrichment cause of action was timely filed. 7
II
Affirmative Defense of Unclean Hands
Dintino apparently contends the trial court erred by denying his motion for summary judgment based on his affirmative defense of unclean hands, arguing the court incorrectly found there was no triable issue of material fact regarding, and he had not proved, that affirmative defense. However, the premise of Dintino’s contention is faulty. In moving for summary judgment and summary adjudication, Dintino did not assert there were no triable issues of fact regarding his affirmative defense of unclean hands and that he was entitled to *355 judgment as a matter of law based on that defense. 8 Rather, he only asserted his motion was “made on the ground that there is no triable issue of material fact as to (1) [Bank’s] one form of action defense, pursuant to ... § 726, to [Dintino’s] first and second causes of action, and (2) [Dintino’s] statute of limitations defense to [Bank’s] third cause of action. Summary judgment or summary adjudication is therefore proper pursuant to ... § 437c.” Although the trial court in denying Dintino’s motion for summary judgment referred to his affirmative defense of unclean hands, he had not argued there were no triable issues regarding that defense in moving for summary judgment. 9 Accordingly, he in effect forfeited or waived that argument below and may not now raise it on appeal as a basis to challenge the trial court’s denial of his motion for summary judgment. 10 To the extent the trial court addressed Dintino’s affirmative defense of unclean hands in its order, that language was mere surplusage and unnecessary to its rejection of his summary judgment motion arguments.
in
Attorney Fees
Dintino contends the trial court erred by denying his motion for an award of the attorney fees he incurred in defending against Bank’s breach of contract cause of action. He argues he is entitled to an award of those fees as a matter of right pursuant to the Note’s attorney fees provision and Civil Code section 1717.
A
As noted above, following entry of the judgment after trial, Dintino filed a motion requesting an award of attorney fees and costs (i.e., $41,285.98) he incurred in defending against Bank’s breach of contract cause of action plus fees and costs incurred in making his motion (i.e., $7,000), arguing he was *356 entitled to those fees under Civil Code section 1717 as the prevailing party on Bank’s only cause of action based on the Note (i.e., its breach of contract claim), which contained an attorney fees provision. The trial court denied Dintino’s motion, stating Bank “achieved its main litigation objectives” and therefore Dintino “is not the prevailing party.” The court explained: “[Bank] filed this complaint essentially to recover the unpaid principal, with applicable interest, on the loan owed at the time Dintino transferred the [Property. [Citation.] Where there are mixed results, a trial court should compare the relief awarded on the contract claim with the parties’ demands on those same claims and their litigation objectives as disclosed by the pleadings, trial briefs, opening statements, and similar sources. [Citation.] In making such comparison, the Court finds the motion should be denied because [Bank] achieved its main litigation objectives herein and Dintino is not the prevailing party.”
B
The Note provided in pertinent part: “If the Note Holder has required me to pay immediately in full as described above, the Note Holder will have the right to be paid back by me for all of its costs and expenses in enforcing this Note to the extent not prohibited by applicable law. Those expenses include, for example, reasonable attorneys’ fees.” “In contract actions, Civil Code section 1717 governs attorney fee agreements.”
(Wakefield v. Bohlin
(2006)
Civil Code section 1717 provides:
“(a) In any action on a contract, where the contract specifically provides that attorney’s fees and costs, which are incurred to enforce that contract, shall be awarded either to one of the parties or to the prevailing party, then the party who is determined to be the party prevailing on the contract, whether he or she is the party specified in the contract or not, shall be entitled to reasonable attorney’s fees in addition to other costs, [f] . . . [][] Reasonable attorney’s fees shall be fixed by the court, and shall be an element of the costs of suit. [][]... [f]
“(b)(1) The court, upon notice and motion by a party, shall determine who is the party prevailing on the contract for purposes of this section, whether or not the suit proceeds to final judgment. . . . \T\he party prevailing on the contract shall be the party who recovered a greater relief in the action on the contract. The court may also determine that there is no party prevailing on the contract for purposes of this section.” (Italics added.)
*357
“Civil Code section 1717 has a limited application. It covers
only
contract actions, where the theory of the case is breach of contract, and where the contract sued upon itself specifically provides for an award of attorney fees incurred to enforce
that
contract.”
(Xuereb v. Marcus & Millichap, Inc.
(1992)
“To achieve its goal, [Civil Code section 1717] generally must apply in favor of the party prevailing on a contract claim whenever that party would have been liable under the contract for attorney fees had the other party prevailed.”
(Hsu v. Abbara
(1995)
C
In this case, the only contract claim alleged by Bank was its breach of contract cause of action based on Dintino’s alleged breach of the Note. In granting Dintino’s motion for summary adjudication on that cause of action based on the section 726 one-action rule, the trial court gave Dintino a simple, unqualified victory on the only contract cause of action. 11 (Hsu v. Abbara, supra, 9 Cal.4th at p. 877.) Accordingly, Dintino was entitled to an award of attorney fees incurred in defending against that cause of action pursuant to the Note’s attorney fees provision and Civil Code section 1717. *358 (Hsu, at pp. 876-877.) As Dintino asserts, had Bank prevailed on that cause of action, it would have been entitled to an award of its attorney fees as the prevailing party on the contract. (Id. at pp. 870-871.) Therefore, Dintino, as the prevailing party on the contract, is entitled to the same right to attorney fees pursuant to Civil Code section 1717.
The trial court could not properly consider Bank’s success on its noncontract causes of action (e.g., unjust enrichment cause of action) in making its determination of which party, if any, prevailed on the contract cause of action. 12 (Hsu v. Abbara, supra, 9 Cal.4th at pp. 873-874.) In so doing, the trial court erred. Accordingly, the trial court erred by denying Dintino’s motion for an award of attorney fees incurred in successfully defending against Bank’s breach of contract cause of action.
Although we conclude the trial court erred in denying Dintino’s motion for an award of attorney fees pursuant to the Note’s attorney fees provision and Civil Code section 1717, we reject his request that we remand the matter to the trial court with directions that it award him the
entire
$48,285.98 in attorney fees and costs he sought. Rather, we remand the matter for the court to determine the amount of
reasonable
attorney fees and costs to be awarded Dintino for successfully defending against that contract cause of action and in making his motion and, in so doing, to exercise its discretion, as appropriate, to apportion his attorney fees and costs between the fees and costs he incurred in defending against Bank’s contract cause of action and the fees and costs he incurred in defending against its noncontract causes of action. (See, e.g.,
PM Group, Inc.
v.
Stewart
(2007)
*359 DISPOSITION
The judgment is reversed to the extent it denied appellant’s motion for an award of Civil Code section 1717 attorney fees. The matter is remanded with directions that the trial court enter a new order and judgment granting that motion and awarding appellant reasonable attorney fees and costs consistent with this opinion. In all other respects, the judgment is affirmed. The parties shall bear their own costs of appeal.
Huffman, Acting P. J., and Nares, J., concurred.
A petition for a rehearing was denied October 2, 2008.
Notes
On July 22, 2008, we requested supplemental briefing by the parties on the effect on this appeal of the action taken by the United States Department of the Treasury Office of Thrift Supervision (OTS) placing plaintiff Bank into receivership. On August 6, the parties submitted a stipulation stating that on July 11 Bank was closed by the OTS and the Federal Deposit Insurance Corporation (FDIC) was appointed as receiver. All of Bank’s deposits and substantially all of its assets, including its rights to this litigation, were transferred to IndyMac Federal Bank, F.S.B. (Successor Bank), a newly chartered bank, and the FDIC was appointed as conservator of Successor Bank. The parties further stipulated that the FDIC, as conservator, stands in the shoes of Bank to prosecute this action and has a substantial legal interest in the subject matter of this action. Accordingly, the parties stipulated that the FDIC be given leave to intervene in this action as conservator for Successor Bank and to substitute itself as respondent in place of Bank. On August 7, we issued an order granting leave for the FDIC, as conservator for Successor Bank, to intervene in this matter and ordered that the FDIC be substituted in place and stead of Bank in this appeal. Although the FDIC, as conservator of Successor Bank, has been substituted as the party in place of Bank, the text of our opinion nevertheless continues to refer to Bank as the plaintiff and respondent in an attempt to avoid confusion. However, our continued reference to Bank in this opinion should not be construed as contrary to our order substituting the FDIC, as conservator of Successor Bank (the transferee of all of Bank’s interest in this action), in place of Bank.
All statutory references are to the Code of Civil Procedure unless otherwise specified.
Prior to October 31, 2002, WAMU apparently was known as PNC Mortgage Securities Corp.
The Note provides in pertinent part: “If the Note Holder has not received the full amount of any monthly payment by the end of 15 calendar days after the date it is due, I will pay a late charge to the Note Holder. The amount of the charge will be 5.000% of my overdue payment of principal and interest.”
Dintino’s letter was dated October 10 and stated: “In reference to loan # 0094285779L] I no longer own this home. The loan is paid. The new owner of this property is Paul Strieker. *340 The property was sold on or around August 31, 2000. Q] Please clear your records as I do not want my credit destroy[ed] by any Tate payments.’ ”
Section 340, subdivision (c), provides a one-year limitations period for “[a]n action for libel [and] slander . . . .”
Because we conclude the trial court correctly concluded Bank’s unjust enrichment cause of action was timely filed and the parties stipulated the only triable issue of fact on that cause of action was the amount of Bank’s damages, we need not address Dintino’s alternative argument that Bank’s cause of action for money lent was barred by the section 726 one-action rule and/or the statute of limitations.
Likewise, we note Bank, in moving for summary adjudication, also did not assert there were no triable issues of fact regarding Dintino’s affirmative defense of unclean hands.
In denying Dintino’s motion for summary judgment, the trial court explained in part: “[Dintino] has not shown any affirmative defense to [Bank’s] cause of action for money lent or unjust enrichment. [Citations.] Unclean hands does not apply because he who would seek equity must do equity and it is undisputed [Dintino] never paid off the loan. . . .”
Furthermore, we note that although Dintino pleaded the affirmative defense of unclean hands in his answer to the complaint, he did not present any evidence to prove that defense at trial, stipulating to a trial on the briefs only on the issue of Bank’s damages on its unjust enrichment cause of action. (Cf.
Ghirardo
v.
Antonioli, supra,
It appears Bank and the trial court considered Bank’s cause of action for money lent to be an equitable, rather than contract, cause of action. Nevertheless, to the extent Bank’s cause of action for money lent was based on the Note, it, like Bank’s breach of contract cause of action, would have been barred by section 726’s one-action rule and Dintino would have prevailed on that claim (to the extent it was contract based). Therefore, Bank cannot show it prevailed on its breach of contract cause of action or any other cause of action “on the contract” (i.e., the Note).
Bank’s quotation of certain excerpts from
Hsu
v.
Abbara, supra,
