
272 Cal.App.2d 352 (1969)
NOMELLINI CONSTRUCTION CO., Plaintiff and Respondent,
v.
PAUL C. HARRIS, Defendant, Cross-complainant and Respondent; HURRICANE STEEL INDUSTRIES, Defendant, Cross-complainant and Appellant.
Civ. No. 1034. 
California Court of Appeals. Fifth Dist.  
Apr. 28, 1969.
 Barbara Lang Betts for Defendant, Cross-complainant and Appellant.
 Mazzera, Snyder & DeMartini and J. Calvert Snyder for Plaintiff and Respondent.
 No appearance for Defendant, Cross-complainant and Respondent.
 CONLEY, P. J.
 Nomellini Construction Co., hereafter called Nomellini, plaintiff and respondent herein, was the successful bidder for the construction of a public housing project in San Joaquin County designated CAL 24-6. It entered into a subcontract with the defendant, cross-complainant and cross-defendant Paul C. Harris, doing business as Harris Fence Co., shortened to Harris in this opinion, to supply and install the fence work and the clothes line supports for Conway Homes Annex, the public housing project. Harris did not comply with the terms of the subcontract; he failed to furnish and install a part of the initial fence work and the clothes line supports contracted for within the time required.
 This action was later begun by Nomellini to recover damages caused by the default of the subcontractor, and it was claimed by the plaintiff and proven, in conformity with the findings of fact and conclusions of law, that Nomellini was damaged by the necessity of getting additional material and labor to install and complete the work involved in the total sum of $11.712.16, that being the amount necessary to expend in excess of the subcontract price agreed upon by Nomellini *356 and Harris. In his answer, Harris admitted the execution of the subcontract and further alleged in a cross-complaint that the cross-defendant, Hurricane Steel Industries, Inc., named Hurricane herein, whose manufacturing plant is near Houston, Texas, was given an order by him in the form of a list of materials which specifically recited: "Material to Meet Federal Specifications," that the cross-defendant undertook to supply such ordered materials, but that the steel parts so shipped were rejected on several successive occasions by the government inspector, resulting in a temporary stop order, and that, solely as a result of the breach by Hurricane of its contract, Harris was rendered unable to comply with the terms of his contract with Nomellini; Harris prayed that if a judgment were granted to Nomellini as against him he should in turn recover the same amount of damages from Hurricane, because the damages which he had caused Nomellini were due entirely to the breach by Hurricane of its contract with Harris. Hurricane in turn filed a cross-complaint against Harris on the theory of an account stated for $12,475, together with interest and costs, and a counterclaim against Harris in the sum of $1,500 as the result of expenses allegedly incurred by it in helping Harris to comply with its contract.
 Section 442 of the Code of Civil Procedure reads as follows: "Whenever the defendant seeks affirmative relief against any person, whether or not a party to the original action, relating to or depending upon the contract, transaction, matter, happening or accident upon which the action is brought or affecting the property to which the action relates, he may, in addition to his answer, file at the same time, or by permission of the court subsequently, a cross-complaint. The cross-complaint must be served upon the parties affected thereby, and such parties may demur or answer thereto, or file a notice of motion to strike the whole or any part thereof, as to the original complaint. If any of the parties affected by the cross-complaint have not appeared in the action, a summons upon the cross-complaint must be issued and served upon them in the same manner as upon the commencement of an original action." Harris thus took advantage of the right granted him by the quoted section of the Code of Civil Procedure and alleged in effect that if a judgment should be granted against him it should also go against Hurricane, because the latter party was, in the final analysis, the sole cause of his own default on the subcontract with Nomellini. [1] The code provision should be interpreted liberally. (Nelson v. Superior *357 Court, 97 Cal.App.2d 78 [217 P.2d 119]; County of Humboldt v. Kay, 57 Cal.App.2d 115 [134 P.2d 501].)
 [2] As pointed out in Bracey v. Gray, 65 Cal.App.2d 282 [150 P.2d 564], the purpose of this code section is to enable a final and binding judgment upon all the matters in dispute between the parties; and in Millar v. Millar, 51 Cal.App. 718, 722 [197 P. 811], it is stated that the purpose of allowing a cross-complaint under the circumstances outlined in the code section is to avoid a multiplicity of suits; the situation set up by the section "involves a consolidation of two independent actions, arising out of or related, to the same transaction." [3] In a suit such as the present one in which a cross-complaint is filed by a defendant bringing into the litigation a third party, it must be apparent that the findings and judgment, in the absence of some counter-consideration cover the entire field of the pleadings, that is to say in the instant case not only the elements contained in the answer to the complaint by Harris but the elements apposite to the contractual and financial relationship of Harris and Hurricane.
 After a lengthy trial, the court filed its memorandum of decision which decided the issues tendered by the complaint and the cross-complaints, including the statement that "Nomellini Construction Company is entitled to a judgment against Paul O. Harris as prayed for in the sum of $11,712.16," and further:
 "(1) That defendant, Hurricane Steel Industries, agreed to furnish Harris supplies in accordance with and under the terms as set forth in paragraph 3 of Harris' cross-complaint."
 "(2) The Court furthermore finds that the allegations contained in paragraphs 4, 5, 6 and 7 are sustained by the preponderance of the evidence."
 "(3) The Court furthermore finds that by virtue of the breach of express warranty by Hurricane to Harris, that Harris sustained the loss equal to the damages claimed by Nomellini Construction Company, to-wit: $11,712.16."
 "With reference to the counter-claim filed by Hurricane, the Court finds in favor of Harris Fence Company and against Hurricane."
 "With reference to the cross-complaint filed for a money judgment by Hurricane against Harris based upon an account stated, the Court finds in favor of defendant Harris and against Hurricane Steel Industries. The reason for this latter finding is occasioned by the fact that there was no evidence of *358 an account stated as between Harris and Hurricane but, to the contrary, Harris denied owing Hurricane any sum whatsoever based on an account stated. There was evidence as to an open book account but I am sure counsel will recall that the representative of Hurricane could not testify as to the authenticity of any of the entries on the open book account."
 "It is, therefore, the judgment of this Court that Nomellini Construction Company recover a judgment against Harris and Hurricane Steel Industries in the sum of $11,712.16."
 No appeal was taken by Harris. There is ample evidence supporting the trial judge's conclusion in favor of Nomellini against Harris, and also his conclusion as between Harris and Hurricane.
 [4] The testimony in the case indicated a claim by Hurricane against Harris for monies alleged to be due by reason of past financial relationship of the two parties, but a survey of the evidence produced by Hurricane, particularly by Griffin, its general sales manager, was so inexact, contradictory and indefinite that the court was entirely justified in finding that Hurricane did not prove a cause of action, and, therefore, was not entitled to any judgment or offset against Harris.
 [5] This conclusion disposes of one of the points suggested by the appellant, namely, that there were two outstanding instances in the course of the trial in which the parties, including Hurricane, agreed that the causes shown by the pleadings, that is to say, the claim made by Nomellini and the claims made as against each other by Harris and Hurricane, might be tried together, but that there should be two judgments. The reason for this agreement is apparent when it is considered that Hurricane was at that time hoping that it could get a counter-judgment or offset against Harris and that such finding would result in a reduction of any amount which Harris might be found to be entitled to as against Hurricane. In such circumstances, it is quite obvious that this suggested procedure would have been of advantage to Hurricane. But, in view of the finding of the court that Hurricane did not prove any offsetting claim against Harris, it is clear that the reason for the agreement disappeared. No other creditor of Harris intervened in the action, and so far as appears in the record, no one other than those to whom a reward was made in the litigation could object to the fact that the trial court determined that Nomellini was entitled to judgment in the same amount that would have been awarded *359 to Harris as against Hurricane. The court's findings are that the failure of Hurricane to supply the correctly designated steel to Harris was the sole cause of Harris' default on the Nomellini subcontract; it, therefore, seems that equitable principles were correctly observed by the trial court in telescoping the claims and permitting a direct judgment in favor of Nomellini against the party whose default required Nomellini to expend $11,712.16 to acquire what Harris had promised in his subcontract and what Hurricane had in turn promised Harris.
 [6] The principle of implied indemnity is basically applicable to the situation disclosed by the record and the findings. Brown v. Rosenbaum, 287 N.Y. 510 [41 N.E.2d 77, 80-81, 141 A.L.R. 1345, 1349], quotes with approval the Restatement of the Law of Restitution, section 76, page 331, as follows: "A person who, in whole or in part, has discharged a duty which is owed by him but which as between himself and another should have been discharged by the other, is entitled to indemnity from the other, ..." And 42 Corpus Juris Secondum, Indemnity, section 20, pages 594, 595, in discussing the same field, says: "The obligation to indemnify may grow out of an implied contractual relation. ... Thus, where one is compelled to pay money which in justice another ought to pay, ... the former may recover from the latter the sums so paid, ... Similarly, if the party secondarily liable on an obligation is obliged to pay the obligation, he is entitled to full reimbursement from the party primarily liable."
 In the circumstances of this case, according to the findings made by the trial judge, the primary and ultimate cause of the failure of Harris to comply with the subcontract was the immediately preceding failure on the part of Hurricane to carry out and meet the terms of its contract with Harris for the supplying of steel. Hurricane's default of duty was the cause of the breach of agreement on the part of Harris on his subcontract with Nomellini. (See also Cahill Bros., Inc. v. Clementina Co., 208 Cal.App.2d 367, 375 [25 Cal.Rptr. 301]; San Francisco Unified School Dist. v. California Bldg. etc. Co., 162 Cal.App.2d 434, 444 [328 P.2d 785]; Great Western Furniture Co. v. Porter Corp., 238 Cal.App.2d 502 [48 Cal.Rptr. 76]; B.F.G. Builders v. Weisner & Coover Co., 206 Cal.App.2d 752 [23 Cal.Rptr. 815].)
 [7] As is said in 27 American Jurisprudence, Second Edition, Equity, section 46, page 568: "Undoubtedly, equity favors the prevention of a multiplicity of actions." [8] This *360 principle is applicable to equitable proceedings generally, and there have been frequent examples of its application to the situation in the present litigation where the plaintiff was entitled to a judgment in damages against a subcontractor, and the subcontractor, in turn, was entitled to a judgment against a third party in exactly the same amount as determined by the court; the third party was the one ultimately responsible for the failure of the subcontractor to observe its agreement with the plaintiff. Consequently, in line with the principle requiring a procedure to avoid a multiplicity of actions, the trial court correctly gave to the plaintiff a judgment not only against the subcontractor but against the corporation ultimately liable for the damages suffered by the plaintiff. Harris' cross-complaint prayed that if he were subjected to a judgment in favor of plaintiff and also prevailed against Hurricane, the court would grant such further relief as was just and reasonable in the premises. The court has done exactly that. In 30 Corpus Juris Secondum, Equity, section 43, pages 860 and 861, it is said: "Where, instead of a complexity of controversies between two parties with respect to the same subject matter, the complexity arises from there being involved the several rights of more than two, each demanding adjustment, and each requiring at law a separate action, equity may take jurisdiction of a suit to which all are parties and therein adjust all rights and determine the whole controversy." See also Whiting-Mead Co. v. West Coast etc. Co., 66 Cal.App.2d 460, 468 [152 P.2d 629]; Wiman v. First Christian Church of Mayfield, 273 Ky. 821 [117 S.W.2d 989, 992]; Sanders & Walker v. Herndon, 128 Ky. 437 [108 S.W. 908, 910]; Young v. Weber, 117 N.J.Eq. 242 [175 A. 273, 277].)
 Section 2607, subdivision 5(a), of the Commercial Code foresees the situation which developed in this case, approves the principle applied here by the trial judge, and provides for a "vouching in" of the third person ultimately liable for the breach of the obligation. In the circumstances of this litigation, we approve of the judgment against Hurricane and in favor of Nomellini.
 [9] We turn to other specific points made by appellant. It is suggested as one of the principal grounds of appeal that the cause of action is barred under the two-year statute of limitations (Code Civ. Proc.,  339) in that the action on the cross-complaint of Paul O. Harris was begun more than two years, but less than four years, after the failure of Hurricane to observe the terms of its contract with Harris.passing over *361 the defective pleading of the statute of limitations by appellant through its lumping of three different sections of the Code of Civil Procedure in one allegation, let us examine the contention of appellant as it developed on the appeal, namely, that section 339 of the Code of Civil Procedure barred the action. This contention is not upheld by the authorities. Section 37, subdivision 1, of the Code of Civil Procedure, makes this cross-complaint timely if filed within four years of "... any contract, obligation or liability founded upon an instrument in writing." The appellant presumably confuses this provision of section 337 with the fact that the contract in question is subject to a demurrer for uncertainty, or, in other words, that it is by no means in model form as a contract. However, the law in California seems clear that this contract for the furnishing of personal property to build certain parts of the fence and certain clothes line supports furnished the basis for the claim filed by Harris in the form of a cross-complaint. The writing setting forth steel parts necessary for the construction of the fence and the clothes line poles, which also carries the provision that government standards must be complied with were apparently calculated to set forth the parts that were to be supplied by Hurricane; the document was approved on its face by the representative of Hurricane in the area, and it clearly implied that it would be usable as the specifications of a contract. [10] As was said by former Chief Justice Gibson in the opinion in Comunale v. Traders & General Ins. Co., 50 Cal.2d 654, 662 [328 P.2d 198, 68 A.L.R.2d 883]: "The promise which the law implies as an element of the contract is as much a part of the instrument as if it were written out." (See also Kirby v. Bank of America N.T. & S. Assn., 4 Cal.App.2d 370 [40 P.2d 943]; Wilson v. Wallace, 113 Cal.App. 278, 286 [298 P. 86]; Tanzola v. DeRita, 45 Cal.2d 1, 6 [285 P.2d 897]; Lawrence Barker, Inc. v. Briggs, 39 Cal.2d 654, 661 [248 P.2d 897]; O'Brien v. King, 174 Cal. 769, 773 [164 P. 631]; Tagus Ranch Co. v. Hughes, 64 Cal.App.2d 128 [148 P.2d 79]; Corporation of Presiding Bishop v. Cavanaugh, 217 Cal.App.2d 492, 516 [32 Cal.Rptr. 144]; Amen v. Merced County Title Co., 58 Cal.2d 528 [25 Cal.Rptr. 65, 375 P.2d 33]; Ravel v. Hubbard, 112 Cal.App.2d 255, 258-259 [246 P.2d 88].)
 There can be no question but that the claim of Harris as against Hurricane was not barred by the statute of limitations, but, on the contrary, was one founded upon an instrument in *362 writing within the meaning of subdivision 1 of section 337 of the Code of Civil Procedure.
 [11] Appellant next suggests that inasmuch as there was ultimately an agreement under which Hurricane furnished for a fair consideration the balance of steel parts which were necessary to complete the subcontract of Nomellini, there was a waiver of the right of Harris to recover on his contract. This contention is not upheld by the facts shown in the record. The later agreement made between Nomellini and Hurricane did not purport to, and did not by virtue of any legal principle, interfere with the rights which Harris then had by reason of his prior contract with Hurricane and Hurricane's failure to perform. Neither was there a waiver by Harris of his claim against Hurricane, nor a rescission by either Harris or Hurricane which impaired Harris' rights. It is true that a letter was written by Hurricane after its breach of the Harris contract, saying that the contract was rescinded, but it should be remembered that the original breach was by Hurricane and that, having caused the damage later found by the trial court, the attempted rescission by Hurricane did not serve to reinstate the agreement which it had made with Harris and had broken to the point of causing Harris' inability to perform his contract with Nomellini.
 The judgment is affirmed.
 Stone, J., and Gargano, J., concurred.
