KANE, J.
Plaintiff Kern Security Systems, Inc. filed a complaint for breach of written contract against defendant Brink's Incorporated, claiming that defendant failed to pay an outstanding balance of $39,445.19. The breach allegedly occurred on January 24, 2006, but the complaint was not filed until March 2, 2010, more than four years later. Defendant demurred on the ground that the cause of action was barred by the four-year statute of limitations. (Code Civ. Proc., § 337.)
Plaintiff's original complaint for breach of written contract was filed on March 2, 2010. The complaint alleged that on December 10, 1999, a written agreement was entered by and between plaintiff and defendant, a copy of which was attached as an exhibit to the complaint. By the terms of said agreement, plaintiff was to provide security equipment and services to defendant for an agreed price. The complaint further alleged that "[o]n or about 01/24/2006" defendant "breached the agreement by failing to pay for services which had been provided on credit at their special instance and request." (Italics added.) "Demand for the outstanding balance owed of $39445.19 was made," but defendant failed to pay all or any part of the remaining balance due. Prejudgment interest was sought from the date of breach—i.e., from "01/24/2006."
Defendant filed a general demurrer because the complaint, on its face, was barred by the four-year statute of limitations applicable to causes of action for breach of written contract. (See § 337).
On June 29, 2010, plaintiff filed and served a document entitled, "Notice of Errata." The notice of errata stated that the complaint "reflects the following error: [¶] The default date of 1/24/2006 [was] incorrect. However, the correct default date is 07/23/2007. Hence, the default date of 01/24/2006 should be replaced with the correct date of 07/23/2007."
Plaintiff filed opposition to the demurrer on June 30, 2010, informing the trial court that the date of breach set forth in the original complaint was erroneous and was the result of a "clerical error." The trial court sustained the demurrer with leave to amend.
Plaintiff filed its FAC on July 22, 2010. In addition to the cause of action for breach of written contract, it included two new (related) causes of action for open book account and account stated. The FAC identified the date of breach as "07/23/2007." The amount owed under the agreement was "39445.19," as was alleged in the original complaint. A copy of the written agreement was attached to the FAC, in addition to copies of several invoices mailed by plaintiff to defendant.
On August 17, 2010, defendant filed its demurrer to the FAC, asserting that the FAC and the causes of action set forth therein were barred under the four-year statute of limitations. Defendant argued in the demurrer that since plaintiff's original complaint was barred by the statute of limitations, plaintiff could not simply change the alleged date of breach without providing an adequate explanation. Further, defendant pointed out that the attached exhibits appeared to show that plaintiff was aware of the amounts due and unpaid ($39,445.19) months before the first invoice dated January 24, 2006, was mailed. Therefore, according to defendant, the exhibits confirmed that the statute of limitations had expired.
Plaintiff filed opposition to the demurrer, which briefly reiterated that the originally alleged date of breach was a clerical error, and plaintiff further claimed the exhibits attached to the FAC substantiated that the true date of breach was July 23, 2007, as alleged in the FAC. The July 23, 2007, date was the due date set forth in the last of the invoices mailed to defendant for amounts owed under the agreement.
On September 14, 2010, the trial court sustained the demurrer to the FAC without leave to amend. The rationale for the trial court's ruling was that the exhibits attached to the FAC indicated plaintiff knew of the breach as early as December of 2005. In light of this fact disclosed in the exhibits, the trial court found that plaintiff's explanation for alleging a more recent date of breach to be inadequate. The demurrer was accordingly sustained, and since no further basis for leave to amend was presented, leave to amend was denied. A judgment of dismissal was entered on October 1, 2010, from which plaintiff timely filed the instant appeal.
"In reviewing the sufficiency of a complaint against a general demurrer, we are guided by long-settled rules. `We treat the demurrer as admitting all material facts properly pleaded, but not contentions, deductions or conclusions of fact or law. [Citation.] We also consider matters which may be judicially noticed.' [Citation.] Further, we give the complaint a reasonable interpretation, reading it as a whole and its parts in their context. [Citation.] When a demurrer is sustained, we determine whether the complaint states facts sufficient to constitute a cause of action. [Citation.] And when it is sustained without leave to amend, we decide whether there is a reasonable possibility that the defect can be cured by amendment: if it can be, the trial court has abused its discretion and we reverse; if not, there has been no abuse of discretion and we affirm. [Citations.] The burden of proving such reasonable possibility is squarely on the plaintiff. [Citation.]" (Blank v. Kirwan (1985) 39 Cal.3d 311, 318.)
Defendant argues that when plaintiff amended the complaint to revise the date of breach, plaintiff was required to adequately explain that material change. Defendant has correctly stated the applicable law. However, as discussed below, we believe plaintiff satisfied that requirement and therefore the FAC should not have been disregarded or treated as a sham by the trial court.
Allegations in an original pleading that rendered it vulnerable to demurrer cannot simply be omitted or altered without explanation. The policy against sham pleading requires the pleader to explain satisfactorily any such change or omission. Otherwise, the original defect will be read into the amended pleading. (Owens v. Kings Supermarket (1988) 198 Cal.App.3d 379, 384; Vallejo Development Co. v. Beck Development Co. (1994) 24 Cal.App.4th 929, 946; Weil & Brown, Cal. Practice Guide: Civil Procedure Before Trial (The Rutter Group 2005) ¶ 6:708, p. 6-178.) "If a party files an amended complaint and attempts to avoid the defects of the original complaint by either omitting facts which made the previous complaint defective or by adding facts inconsistent with those of previous pleadings, the court may take judicial notice of prior pleadings and may disregard any inconsistent allegations. [Citations.]" (Colapinto v. County of Riverside (1991) 230 Cal.App.3d 147, 151-152.)
Here, plaintiff originally alleged a date of breach that made the complaint vulnerable to attack under the four-year statute of limitations applicable to a cause of action for breach of written contract. (See § 337.) Specifically, paragraph 6 of the complaint alleged that the breach occurred on January 24, 2006, yet the complaint was not filed until March 2, 2010. Thus, on its face, the complaint was time-barred under the statute of limitations. That being so, when plaintiff filed the FAC, changing the alleged date of breach to July 23, 2007—a date within the four-year limitations period—plaintiff was obliged to provide an adequate explanation for that self-serving change to a critical allegation.
Although we agree that it was necessary for plaintiff to offer a reasonable explanation for its changed allegation, we conclude that plaintiff did so. Plaintiff not only promptly informed the trial court and opposing counsel that the date of breach stated in the original complaint was a clerical error, but also attached several invoices as exhibits to the FAC to substantiate the later date of breach. To the extent that the exhibits to the FAC reasonably supported the revised allegation or otherwise reflected that the complaint may have been timely filed, we think the trial court should not have treated the FAC as a sham. "The purpose of the [sham pleading] doctrine is to enable the courts to prevent an abuse of process. [Citation.] The doctrine is not intended to prevent honest complainants from correcting erroneous allegations or to prevent the correction of ambiguous facts. [Citation.]" (Hahn v. Mirda (2007) 147 Cal.App.4th 740, 751.) As explained below, we hold the exhibits attached to the FAC presented facts sufficient to overcome defendant's general demurrer on statute of limitations grounds.
Before considering the exhibits, we note the basic rule that for a defendant to succeed in raising the statute of limitations defense on demurrer, it must be shown from the allegations and/or matters subject to judicial notice that the action is clearly and necessarily barred. "A demurrer based on a statute of limitations will not lie where the action may be, but is not necessarily, barred. [Citation.] In order for the bar of the statute of limitations to be raised by demurrer, the defect must clearly and affirmatively appear on the face of the complaint; it is not enough that the complaint shows that the action may be barred. [Citation.]" (Marshall v. Gibson, Dunn & Crutcher (1995) 37 Cal.App.4th 1397, 1403.)
The reviewing court accepts as true not only those facts alleged in the complaint but also facts that may be implied or inferred from those expressly alleged. (Marshall v. Gibson, Dunn & Crutcher, supra, 37 Cal.App.4th at p. 1403.) We give the complaint a reasonable interpretation, reading it as a whole and its parts in their context. (Evans v. City of Berkeley (2006) 38 Cal.4th 1, 6.) In our review of the sufficiency of the allegations to state a cause of action, facts appearing in exhibits attached to the complaint are also accepted as true and, if contrary to the allegations in the pleading, will be given precedence. (Dodd v. Citizens Bank of Costa Mesa (1990) 222 Cal.App.3d 1624, 1627.)
Attached as exhibits to the FAC was a series of eight invoices. The account number specified at the top of each invoice (i.e., K310819) was the same account number that was set forth on the written agreement. The billing date of each respective invoice, along with the amount billed and the due date thereof, was as follows: (1) January 24, 2006, invoice No. 181044, for $5,197.99, due on February 18, 2006; (2) December 15, 2006, invoice No. 202406, for $769.08, due on January 9, 2007; (3) January 15, 2007, invoice No. 204344, for $769.08, due on February 9, 2007; (4) February 8, 2007, invoice No. 50815, for $25,627.73, due on March 5, 2007; (5) February 26, 2007, invoice No. 71926, for $83.79, due on March 23, 2007; (6) February 26, 2007, invoice No. 71927, for $83.79, due on March 23, 2007; (7) March 5, 2007, invoice No. 72023, for $6,834.13, due on March 30, 2007; and (8) June 28, 2007, invoice No. 73830, for $79.60, due on July 23, 2007.
When all eight of the invoiced amounts are added up, the sum is exactly $39,445.19—the precise amount claimed in the original complaint and in the FAC. Other than the first invoice in the series (dated Jan. 24, 2006), each of the invoices stated that the particular sum specified therein had a "Due Date" in calendar year 2007. Thus, if we considered only the due dates referenced in seven of the eight invoices, the sums reflected therein would clearly be within the four-year statute of limitations period, since the complaint was filed on March 2, 2010. As to the January 24, 2006, invoice, plaintiff argues that a special rule of accrual pertaining to written accounts will bring even that invoice (and the obligation reflected therein) within the four-year statute of limitations. It is unnecessary to reach that particular argument. At this point, we simply note that the exhibits attached to the FAC plainly showed sums being billed and becoming due under the agreement during 2007, well within the four-year period. That is sufficient to overcome the demurrer.
Why then did the trial court conclude that the four-year statute of limitations set forth at section 337 barred plaintiff's causes of action? The reason apparently relates to an ambiguity created by other information contained in the invoices. That is, the invoices contained additional information besides a currently billed amount and a due date for same. There was also a separate line item on the invoices that reflected any past due balance owing on the continuing agreement, along with a statement of how long such balance was past due. Critically, at the end of the invoice dated January 24, 2006, it stated that the sum of "$39,445.19" was at that time "105 Days" past due. Taken at face value, this statement in the invoice would mean that defendant's breach with respect to the entire amount of $39,445.19 occurred 105 days prior to January 24, 2006, or sometime in late 2005, resulting in the inescapable conclusion that the statute of limitations expired long before the complaint was filed on March 2, 2010.
There is no doubt that the invoices were internally inconsistent on the issue of when the agreement was breached. On the one hand, it appeared from the due dates stated on the invoices that most of the $39,445.19 became due sometime in 2007, well within the four-year period. On the other hand, it appeared from the separate line item on the January 24, 2006, invoice relating to past due balances that the entirety of the $39,445.19 became due, for purposes of the breach, sometime in late 2005. Thus, the attached exhibits were reasonably susceptible to one interpretation that would tend to negate the statute of limitations defense, but they were also reasonably susceptible to another interpretation that would tend to establish the statute of limitations defense.
The crucial issue is whether a general demurrer should be sustained in the face of such ambiguity. The answer is no. If an exhibit is ambiguous and can be construed in the manner stated in the complaint, the trial court must accept the construction offered by plaintiff. (SC Manufactured Homes, Inc. v. Liebert (2008) 162 Cal.App.4th 68, 83; Aragon-Haas v. Family Security Ins. Services, Inc. (1991) 231 Cal.App.3d 232, 239.) Because of the ambiguity regarding the date of breach created by the exhibits, the trial court should not have rejected the later date of breach indicated in the FAC. Thus, the demurrer should not have been sustained—and especially not without leave to amend. (CrossTalk Productions, Inc. v. Jacobson (1998) 65 Cal.App.4th 631, 635 [a general demurrer should not be sustained based on ambiguous facts; nor is a demurrer the appropriate procedure for determining the truth of disputed facts or what inferences should be drawn where competing inferences are possible].) Here, as discussed above, a reasonable possibility was shown by the exhibits that plaintiff's damage claims, or a portion of them, were not barred by the statute of limitations. Accordingly, defendant failed to show that the statute of limitations necessarily barred plaintiff's action. (Marshall v. Gibson, Dunn & Crutcher, supra, 37 Cal.App.4th at p. 1403 [demurrer must affirmatively show the action is clearly and necessarily barred by the statute of limitations]; Roman v. County of Los Angeles (2000) 85 Cal.App.4th 316, 324-325 [same].) Under such circumstances, the demurrer on the ground of statute of limitations should have been overruled.
In passing, we note plaintiff's reply offers a further explanation for why the January 24, 2006, invoice attached to the FAC contained a statement that $39,445.19 was 105 days past due. Plaintiff's reply suggests that when the invoices were reprinted to attach them to the FAC, which reprinting was obviously after July 23, 2007 (the last due date indicated in the invoices), a running balance of the amount owed at the time of the reprinting was inadvertently inserted onto the remittance portion of that invoice. At the time of the reprinting, the amount owing would have been $39,445.19. That is, the $39,445.19 was due at the time of the reprinting of the exhibits (for attachment to the FAC), but not at the time the invoice was originally issued. Although this proposition would appear to be a plausible explanation for the presence of the conflicting information in the invoices, we need not reach that issue here. For the reasons alluded to above, it was error for the trial court to sustain the demurrer, regardless of the merits of plaintiff's proffered further explanation.
Because the invoices attached to the FAC were clearly sufficient to overcome the demurrer, it is unnecessary to address or resolve arguments regarding the validity of the specific date of breach alleged in the FAC. We do, however, offer a few brief comments on that issue. The causes of action in the FAC were for breach of written contract, open book account and account stated, all of which come under the same four-year statute of limitations found at section 337. The FAC alleged that the breach of contract or default occurred on July 23, 2007. That particular date in 2007 was selected by plaintiff based on the rule that where a contractual cause of action is founded on a written book account or account stated, the cause of action accrues from the date of the last item in the account. (§ 337, subd. 2; see 3 Witkin, Cal. Procedure (5th ed. 2008) § 515, p. 659; Bloom v. Bender (1957) 48 Cal.2d 793, 799.) It is apparent that by framing the pleading as one premised on an account, plaintiff is claiming that all of the sums in all eight invoices (including the Jan. 24, 2006 invoice) have a common accrual date of July 23, 2007, which is the date when the last invoice arguably became due. Defendant argues that plaintiff may not, by merely recasting the obligation as an account, avoid the standard rule that accrual occurs when the contract is breached. (See Parker v. Shell Oil Co. (1942) 55 Cal.App.2d 48, 55.) Of course, even if for statute of limitations purposes the obligations reflected in the invoices were not part of a single account, and even if each of the invoices created a severable breach, the invoices described sums becoming due within the four-year statute of limitations, or they were reasonably susceptible to that interpretation. (See, e.g., 3 Witkin, Cal. Procedure, supra, §§ 520-522 at pp. 664-667.) Therefore, regardless of the outcome of the dispute whether the precise date of the breach was actually July 23, 2007, we conclude that the exhibits attached to the FAC—and the facts reasonably indicated therein—were sufficient to overcome the general demurrer.
Judgment of dismissal was entered in this case on October 1, 2010. On October 12, 2010, plaintiff filed a new complaint and summons against defendant alleging the same amount due ($39,445.19) and setting forth the same causes of action premised on breach of the same contract. On November 3, 2010, plaintiff apparently realized the error of its ways and dismissed the new complaint with prejudice. Thereafter, plaintiff timely filed and pursued the instant appeal.
Defendant has moved to dismiss the instant appeal on the ground of res judicata, arguing that because plaintiff dismissed its new complaint with prejudice, it was the equivalent of a final judgment on the merits, thereby barring the entire action including the present appeal. (See Boeken v. Philip Morris USA, Inc. (2010) 48 Cal.4th 788, 793 [for purposes of res judicata, a dismissal with prejudice is the equivalent of final judgment on the merits].) Plaintiff counters that because the trial court had already entered a judgment of dismissal in this case, the action was already terminated and, therefore, the dismissal of the new complaint had no effect, validity or bearing on the present appeal.
We conclude plaintiff is essentially correct and, therefore, we deny the motion to dismiss the present appeal. We think the first judgment—the trial court's judgment of dismissal—is the only actual judgment in the action and it governs the right to appeal. Once the trial court entered its judgment of dismissal on October 1, 2010, the action was thereby terminated, further jurisdiction ended (Estate of Garrett (2008) 159 Cal.App.4th 831, 838; § 581d), and the judgment became conclusive between plaintiff and defendant with respect to the subject matter of the action (Torrey Pines Bank v. Superior Court (1989) 216 Cal.App.3d 813, 821). We do not believe that plaintiff's erroneous refiling of the complaint could validly reopen the case in the trial court. Therefore, the dismissal of the erroneously refiled complaint did not operate as a new and different judgment that somehow trumped the first one. The case had already been terminated and conclusively adjudicated in defendant's favor and, therefore, plaintiff's sole recourse was to appeal from the judgment of dismissal, which it ultimately did. The motion to dismiss is denied.
The judgment is reversed. The matter is remanded to the trial court with directions that it vacate its order sustaining defendant's demurrer to the FAC without leave to amend and enter a new order overruling the demurrer. Costs on appeal are awarded to plaintiff.
Wiseman, Acting P.J. and Levy, J., concurs.