Harrison, J.
In February, 1891, the plaintiff being largely indebted to Mrs. Adella B. Story, defendant, and also to other creditors, made an agreement with her as follows:
“ Whereas, Mrs. A. B. Story has agreed to pay all the debts existing against the Story & Isham Commercial Company on the first day of February, 1891, including those payable to herself, and, whereas, said Story & Isham Commercial Company desires to secure said Mrs. Story for the payments made and to be made by her on account of the said debts:
• “ Now, therefore, in consideration of said agreement and the payment of said debts, the said Story & Isham Commercial Company, pursuant to a resolution of its board of directors, at a meeting thereof duly called and had, hereby agrees to pay to said Mrs. A. B. Story all sums paid, or agreed to be paid, by her on account of *32said debts, including costs and expenses, notes, attorneys’ fees and judgments, and such things as she may pay on account of said debts, and in procuring the money with which to meet the same.
“And, as security for the payment of said sums, the Story & Isham Commercial Company agrees to and does sell, assign, convey and transfer to said Mrs. A. B. Story all notes, accounts and other demands due or payable to said company, and all goods and merchandise on hand, in store or in transit, owned by it, and all other property owned by it at law or in equity; excepting, however, that said company reserves the right to use in its business the first sums collected by it, either on sales made or demands due, not exceeding two thousand dollars, and also reserves the real estate owned by it, but all sums realized from a sale, pledge or mortgage thereof, not exceeding three thousand dollars, shall be applied as a payment on the sums payable to said Mrs. A. B. Story, as above specified.
' “Said Commercial Company shall use its best efforts to realize as soon as practicable on said demands and merchandise, and apifiy the sums received therefor on the sums payable to said Mrs. A. B. Story, as herein provided.
“ The expense of running the said company shall be divided between the old business and the new in proportion to the sales made on account of the goods hereby sold to Mrs. Story, and those sold on account of transactions subsequent to February 1, 1891.
“The property hereby conveyed to Mrs. A. B. Story shall not be sold at less than it cost the Commercial Company, without a direction of the board of directors of said company.
“ Executed and delivered this fifth day of February, 1891.
“ The Story & Isham Commercial Co.,
“ Per A. H. Isham, Vice-Pres. and Mgr.
“Adella B. Story.”
At that time the plaintiff was engaged in the business of merchandising, and was o turner of certain personal *33property which it had in its custody, and which was included in the aforesaid agreement. On the 26th of February, 1891, Mrs. Story, without the knowledge and consent of the plaintiff, sold to the defendant Bates a portion of said personal property, who took possession thereof without the consent of the plaintiff, and after-wards sold and disposed of the same. On the 2d of March, 1891, the plaintiff brought this action against the defendants for the conversion of the personal property so conveyed by Mrs. Story to the defendant, Bates. The defendants, in their answer, set up the foregoing agreement and the circumstances under which it was made, alleging performance by Mrs. Story of her part of the agreement, and that she had paid out on account of the debts of the plaintiff the sum of about $115,000, and that there was due to her above the value of the property which she had sold to Bates upwards of $50,000, and prayed for an accounting and judgment in her favor against the plaintiff.
The court finds that the cost price of the property sold by Mrs. Story to Bates was $38,550; that that was also the value of the same; that at the time when she sold the goods the plaintiff was indebted to her in the sum of $24,206, and that she had also caused debts of the plaintiff to the amount of $5,523 to be satisfied by having its creditors accept in satisfaction of said debts certificates of deposit issued therefor by the California National Bank of San Diego. The court also found “ that by an arrangement between the defendant, Adella B. Story, and the California National Bank, the said bank, on the twenty-sixth day of February, 1891, canceled and marked paid notes of the plaintiff held by said bank in the sum of $15,200, and the same were thereby paid ”; and also that, after the sale and taking of said property, she had paid the balance of the debts of the plaintiff,amounting with the sum paid and amounts due her to $113,000, a portion of which was paid out of the proceeds of the property sold by her to Bates. Upon these findings the court made its conclusions of law that the *34plaintiff was entitled to recover from the defendants the value of the property converted by them, with interest thereon, amounting to $40,678.79, less $29,717.54, the amount with interest thereon due from the plaintiff to Mrs. Story, and the amount for which she had caused its debts to be satisfied by the certificates of deposit issued by the bank; and that the plaintiff was entitled to judgment in the sum of $10,961.25, and rendered judgment accordingly. From this judgment both parties have appealed; the plaintiff upon the ground that the court erred in allowing any deductions from the value of the goods sold by Mrs. Story to Bates; and the defendants on the ground that Mrs. Story should have been allowed the entire amount of her payments for the plaintiff, and should have had a judgment in her favor for the difference between that amount and the value of the goods.
It is contended by the plaintiff in the first place that the matters set forth in the answer do not constitute a counterclaim to the cause of action set forth in the complaint, and were not available as a defense thereto.
Section 438 of the Code of Civil Procedure provides that the counterclaim which the defendant is permitted to plead “must be one existing in favor of a defendant and against a plaintiff between whom a several judgment might be had in the action, and arising out of one of the following causes of action:
“ 1. A cause of action arising out of the transaction set forth in the complaint as the foundation of the plaintiff’s claim, or connected with the subject of the action.”
One of.the definitions given by the “ Century Dictionary” to the term “ transaction” is “ a matter or affair, either completed or in course of completion.” Mr. Pomeroy, in his treatise on Remedies and Remedial Rights, sec. 774, defines the term, as used in this section, to be: “That combination of acts and events, circumstances and defaults, which viewed in one aspect results in the plaintiff’s right of action, and viewed in another aspect results in the defendant’s right of action;” *35and says further: “ As these two opposing rights cannot-be exactly the same, it follows that there may be, and generally must be, acts, facts, events and defaults in the transaction as a whole which do not enter into each cause of action, but are confined to one of them alone.” (See, also, Xenia Branch Bank v. Lee, 7 Abb. Pr. 372; Ritchie v. Hayward, 71 Mo. 560; Judah v. Trustees, 16 Ind. 60.) Every transaction is more or less complex, consisting of various facts and acts done by the respective parties, and it frequently happens that one of more of these acts would, if viewed by itself, be such a violation of duty as to give to the other a right of action, but the obligation thus created may be so counterbalanced by other matters growing out of the same transaction that no compensation ought to be made therefor. While the parties are carrying their agreement into execution, and mutual rights and obligations accrue by reason of the failure of either or both of them to comply strictly with its terms, neither party should have the right, so long as the agreement is in force and is in process of execution, to recover the damage sustained by him from any breach of duty by the other, without at the same time satisfying any obligation against himself growing out of the same affair. In such a case the rights of the one are so dependent upon the rights of the other, that simple equity requires that the respective causes of action in behalf of each should be adjusted in a single suit. From an early day the tendency of judicial decisions has been to avoid circuity of action and multiplicity of suits, by permitting matters growing out of the same transaction which might constitute an independent cause of action to be given in evidence by way of defense, and the foregoing section of the Code of Civil Procedure is an additional legislative step in the direction of this judical tendency. As a corollary therefrom it follows that the form in which the plaintiff may set out his cause of action ought not to be conclusive upon the right of the defendant to set forth his counterclaim in his answer. The plaintiff is to set forth the facts which constitute *36his cause of action, but, if the other facts in the transaction are so connected with those set forth as to defeat their legal effect, the defendant is not precluded from setting them up by reason of the form which the plaintiff may have chosen for presenting his own side of the case. (Pomeroy on Remedies, sec. 772; Gordon v. Bruner, 49 Mo. 570; Brady v. Brennan, 25 Minn. 210; Bitting v. Thaxton, 72 N. C. 549; Thompson v. Kessel, 30 N. Y. 383; Chandler v. Childs, 42 Mich. 128.)
It is for the purpose'of enabling the court to render a judgment by which the rights of the parties may be finally determined in the same action, rather than to compel another action, that the code permits a defendant to set up in his answer any new’' matter arising out of the transaction set forth in the complaint as the foundation of the plaintiff’s claim; and, if the plaintiff omits or fails to set forth in his complaint the entire transaction out of which his claim arose, the defendant may supplement this omission by setting forth in his answer the omitted facts so that the entire transaction may be before the court. The plaintiff is not at liberty to select an isolated act or fact which is only one of a series of acts or steps in the entire transaction, and insist upon a judgment on this fact alone, if the fact is so connected with others that it forms only a portion of the transaction.
The transaction which was the foundation of the cause of action set forth in the complaint herein is not limited to the facts therein set forth, but includes the entire series of acts and mutual conduct of the parties in the business or proceeding between them which formed the basis of their -written agreement. If the plaintiff had set out in its complaint the entire transaction between it and Mrs. Story, beginning with the agreement and the circumstances under which it was made, and giving in detail her sale of the property to Bates, that its value -was thirty-eight thousand five hundred and fifty dollars, and that the proceeds thereof had been applied by her in payment of its debts, and also *37showing that in pursuance of said agreement she had paid the entire debts of the plaintiff, amounting to one hundred and thirteen thousand dollars, it would then have appeared upon the face of the complaint that the plaintiff was not entitled to recover from her the value of the property sold by her without at the same time recompensing her for the payments that she had made for its account. If, on the other hand, Mrs. Story had brought an action against the plaintiff for the amount of money paid by her under the agreement, the plaintiff would have had the right to deduct from that amount the value of the property sold by her, and it would not have lain in her mouth to say that she was a trespasser, and therefore not liable to have her tort set off against the contract of the plaintiff. . But the rights of the several parties to plead a counterclaim in defense to an action by one against the other for a breach of their respective obligations arising out of the facts in controversy between them must be reciprocal. The entire transaction between them and the rights resulting therefrom are to be determined by the court, and it is incumbent upon the court, after hearing all the proof relative to that transaction, to render such judgment as may be consistent 'with, the case as presented by both parties.
Much of the argument of the plaintiff has been directed to the terms of section 2910 of the Civil Code, which provide that the wrongful conversion of personal property by a person holding a lien thereon extinguishes the lien. But, as this action is brought to recover the value of the goods, and not for the goods themselves, the right of the defendant to assert a lien thereon is not involved. If the plaintiff had brought its action against Mrs. Story to recover possession of the goods, the effect of this section would have properly arisen, but by bringing it for the value of the goods he adopts her sale, and affirms the title conveyed thereby. It is a well-established principle that when one has converted to his own use or sold the goods of another, the latter may waive the tort and sue in assumpsit. It is immaterial in which mode he seeks *38redress for the wrong. In either case he can claim only a pecuniary compensation; and whether he claim this in assumpsit, as upon a sale, or for the value of the goods, as by conversion, he establishes only a pecuniary obligation, which the defendant may controvert by any facts connected with the transaction out of which the plaintiff's claim arose. The form in which the plaintiff brought the present action is immaterial, as it might have treated the defendant as having received the proceeds of the goods sold by In.r, and sued her therefor. But whatever form of action it might select, it was only entitled to compensation ’for the goods, and in a suit for the talcing it could only receive the amount in which it had been damaged. By its agreement with Mrs. Story it had appropriated this property to the payment of its obligation to her, and in the absence of any finding or any claim by it that it has suffered diminution of estate or damage beyond the value of the property, if that value was appropriated by her to the purpose to which the parties had agreed it should be ajjpropriated, it cannot claim any further compensation from her. By its agreement with her it placed itself under an obligation to her for the payment of all the moneys which she should advance for its debts; and as the court finds that she has paid therefor the sum of one hundred and thirteen thousand dollars, it can only claim that the value of the property sold by her be deducted from that amount. By treating the goods as the property of the defendant and suing merely for their value, the plaintiff has elected to treat the obligation as of a fixed value, and it is immaterial in what form it Stated its cause of action. In either case it would be competent for Mrs. Story to show that by virtue of the agreement between them the property had been subjected to the payment of the plaintiff's obligation to her, and that she had made such application, and to ask that the remainder of the unperformed part of the contract should be enforced.
The court finds that at all times after making the said agreement Mrs. Story claimed that by virtue *39thereof she had become the owner of the property mentioned therein, and it follows that her making a sale of it to Bates was in pursuance of her construction of its terms. The further finding of the court that her sale was made to Bates with the agreement on his part that he would pay the cost price of said property on the debts of the plaintiff for which she had become liable also supports the position that she made the sale in purported compliance with the terms of the agreement. The agreement itself is not free from ambiguity, and it is not an unnatural construction that it was the intention of the parties that after its execution the goods should remain in the custody of the plaintiff, and that either party should have the right to sell and dispose of the same, and that all sales made by either party should be applied in reduction of the debts of the plaintiff that had been assumed by Mrs. Story. Her claim to have become the owmer of the property by virtue of the agreement must be assumed to have been made by her in good faith, and there is no finding of fraud or oppression, or of any willful wrong out of which a right to any punitory damages could accrue to the plaintiff. It is clear from the findings that Mrs. Story was not acting in any repudiation of the agreement by which the property was conveyed to her, but in accordance with her own construction of its effect. If that construction was erroneous, so that the plaintiff suffered loss thereby, the result of such construction may have given the plaintiff a cause of action against Mrs. Story; but it does not follow that it is entitled to recover damages from her independent of an adjustment of their respective rights under the entire agreement. Mrs. Story had a cause of action against the plaintiff for the money paid by her in releasing it from its debts, and this cause of action “arose out of”—that is, it resulted from—the same transaction or negotiation as did the plaintiff’s right to compensation for the goods which were sold by her to Bates. Both had their origin in the agreement between them for the payment by her of the debts, and *40the appropriation by the plaintiff of its property as a mode of reimbursing her, and the sale of the goods by her, as well as her payment of the debts, were only separate acts in carrying out the terms of their agreement and completing this transaction. The act of Mrs. Story in making a sale to Bates of the property described in the complaint was so connected with the business referred to in the agreement between her and the plaintiff that the entire transaction must be considered in order to determine whether her act was wrongful or right; and even if it should be held that the sale to Bates was not specifically authorized by the terms of the agreement, it is clear from the findings of the court that it Avas not done in any repudiation of the agreement. She purported to act under and not in antagonism to the agreement, so that the plaintiff’s right of action Avould be for damages resulting from a breach of a portion of the agreement rather than for an invasion by her of its rights, independent of and disconnected with the obligation created by the agreement.
The contention of the plaintiff that, inasmuch as this action is brought against the three defendants, a cause of action existing in favor of Mrs. Story alone is not available as a defense, cannot be maintained. The liability of the defendants, if any existed, is several as well as joint, and if Mrs. Story could set up any defense that Would defeat the plaintiff’s right of recovery it was available for the other defendants. Whatever shows that the plaintiff had no right of recovery, as against Mrs. Story, protects the other defendants, who were acting under her and by her authority.
The sum of fifteen thousand two hundred dollars, which the court finds is the amount of the debts of the plaintiff which Mrs. Story caused to be paid on the same day that she sold the goods to Bates by an arrangement between her and the California National Bank, added to the twenty-nine thousand seven hundred and seventeen dollars and fifty-four cents, Which the court also finds was due her from the plaintiff at that *41time, shows that she had then paid more than the entire value of the goods, and, consequently, she should not be charged with any interest upon that value.
As the court finds that Mrs. Story had fully complied with her part of the agreement, it follows that judgment should have been rendered in her favor for the difference between the amount paid by her for the account of the plaintiff and the value of the goods sold by her to Bates, and the judgment of the court below is reversed, with directions to enter judgment against the plaintiff and in favor of Mrs. Story for the sum of seventy-four thousand four hundred and fifty dollars, with her costs of suit, as of the tenth day of December, 1891.
De Haven, J., McFarland, J., and Fitzgerald, J., concurred.
Rehearing denied.