
215 Cal.App.2d 13 (1963)
FRANK M. SMITH, Plaintiff and Respondent,
v.
NORMAN I. FADEL, INC., Defendant and Appellant.
Civ. No. 20538. 
California Court of Appeals. First Dist., Div. Two.  
Apr. 11, 1963.
 Hill & Dalton and Charles V. Moore for Defendant and Appellant.
 Falk & Falk and Charles E. Buxton, Jr., for Plaintiff and Respondent.
 AGEE, J.
 The complaint is in two counts, the first being a common count for "goods sold and delivered" in the amount of $655.20, and the second being for damages in the sum of $755 for breach of contract. The prayer is for $1,410.20. Plaintiff recovered a judgment in the amount of $755 and defendant appeals therefrom.
 [1] Although defendant states in his brief that the court "found for plaintiff on the first cause of action," this would appear to be in error. The two counts are not treated separately in the findings but the following finding would seem to make it clear that the recovery is based upon the second count: "By reason of the said agreement and its said cancellation, there is due from Defendant Norman I. Fadel, Inc. to Plaintiff Frank M. Smith, damages in the sum of $755.00." The only finding that could be said to refer to the first count is the general one that "each and every allegation in the complaint of Plaintiff Frank M. Smith is true." The sufficiency of the findings is not questioned by defendant.
 The sole issue on appeal is whether it was error for the trial court to disallow certain evidence offered by defendant as a counterclaim when only a general denial was pleaded in its answer as to each count of plaintiff's complaint.
 In January 1957 plaintiff and defendant entered into an agreement for the seeding and fertilizing of a certain area of land along a strip adjacent to a highway being constructed by defendant and also for the delivery of certain straw to be used in erosion control. The agreement specified the prices to be paid. The total amount involved was approximately $10,000. *15 Defendant paid for the straw in advance, and it was delivered in June and July 1957.
 On September 17, 1957, defendant wrote to plaintiff, requesting a cancellation of the seed and fertilizer portion of the agreement. The letter stated that, if plaintiff had already obtained the material, defendant would take it "off of your hands," adding that "you are entitled to some benefit for your efforts in securing the material and we will make some adjustment to cover this."
 Plaintiff testified as follows: "I then got in touch with Mr. Fadel [defendant's officer in charge] and wrote him a letter to the effect that inasmuch as the seed had to be ordered early and had to be ordered by me and was purchased and I had already had to pay for it, that I could not cancel the seed, but inasmuch as the fertilizer could be canceled, I would be glad to co-operate with him and do so, which he was very appreciative of and notified me that he would be glad to reimburse me for any extra trouble that I had been caused. So then when I notified him that I couldn't cancel the seed he had the seed delivered to his warehouse here in Eureka and, of course, since then he has never paid for it."
 The seed cost plaintiff $630 plus sales tax of $25.20, or a total of $655.20. The trial court said, in its "Memorandum of Opinion": "In this case it is a very difficult matter to determine damages. It would appear to the Court that plaintiff is entitled to recover for the value of the seed. How to determine any other damages is very difficult due to the complete lack of evidence introduced on the subject."
 In any event, the total award of damages was fixed at $755, which allowed plaintiff $99.80 over and above the cost of the seed to him. The adequacy of this award is not an issue on appeal.
 The second count of the complaint alleges that "the plaintiff and defendant entered into a contract, ... by which the plaintiff undertook and agreed to fertilize and seed certain land areas located in the County of Humboldt, State of California, which land areas were to be fertilized and seeded in connection with State Highway Project 1--HUM--1--J"; that plaintiff was at all times "ready, willing and able to perform his part of the contract"; that "the defendant refused to allow plaintiff to perform said contract to the plaintiff's damage in the sum of $755.00." As stated above, defendant filed only a general denial.
 [2] At the trial, defendant attempted to introduce evidence *16 concerning the straw, to wit, that some of it had been delivered to a place some 1,000 feet away from the job site, that some of the bales of straw were broken upon delivery, and that some of the straw was delivered during a hard rain, thereby causing it to become wet and rotten. All of this evidence was objected to by plaintiff but it was allowed to come in subject to a motion to strike. At the conclusion of the trial, the court sustained plaintiff's objections and struck out all of said evidence.
 The ruling was correct. The offered evidence was not within the issues raised by the pleadings. It attempted to prove a setoff or counterclaim which should have been so pleaded in defendant's answer.
 Subject 437, subdivision 2 of the Code of Civil Procedure requires that the answer of the defendant shall contain "[a] statement of any new matter constituting a defense or counterclaim." Section 438 of the Code of Civil Procedure determines when a counterclaim is proper. It provides: "The counterclaim mentioned in section 437 must tend to diminish or defeat the plaintiff's recovery and must exist in favor of a defendant and against a plaintiff between whom a several judgment might be had in the action; ..." Section 439 of the Code of Civil Procedure provides: "If the defendant omits to set up a counterclaim upon a cause arising out of the transaction set forth in the complaint as the foundation of the plaintiff's claim, neither he nor his assignee can afterwards maintain an action against the plaintiff therefor."
 It may be noted that section 439 is an application of the doctrine of res judicata in that it provides that the sanction imposed for failure of a defendant to set up a counterclaim is that he cannot "afterwards maintain an action against the plaintiff therefor."
 However, the principle involved in that section is applicable to the instant case. As stated in 2 Witkin, California Procedure, Pleading, section 585, page 1595, after a discussion of "permissive" cross- claims: "But if the cross-claim tends to diminish or defeat the plaintiff's recovery and arises out of the transaction, it must be pleaded or is barred." (Italics in text deleted.)
 Defendant attempts to avoid this well-settled general rule by urging that an exception thereto should be recognized when the plaintiff's cause of action is based upon a common count. Defendant states that "if the plaintiff is allowed to plead generally, the defendant should be allowed to deny generally." Defendant cites but one decision in support of this contention, *17 Aetna Carpet Co. v. Penzner, 102 Cal.App.2d 859 [228 P.2d 347].
 As we have seen, the cause of action upon which plaintiff recovered in the instant case was not pleaded as a common count. It was pleaded as an action for damages for the breach of an agreement. It is therefore unnecessary to discuss defendant's contention herein.
 [3] Moreover, we do not believe that Aetna, supra, supports the contention made by defendant. The complaint there was on a common count. The "goods, wares and merchandise" delivered to defendants included a white carpet. The answer was a general denial. The court refused to permit defendants to show that the carpet delivered was not the one they had purchased. This was on the ground that no such defense had been pleaded. Defendants then requested leave to amend. (This was not done in the instant case.) The request was denied. The refusal of the court to admit such evidence was held to be error. The appellate court stated: "The witness [for plaintiff] had testified that the defendants had been sold a white carpet and was equally positive that the carpet selected had been delivered. Having testified that a white carpet had been delivered it was certainly proper cross-examination to question the witness as to whether or not the carpet sold was, in fact, delivered. Respondent having pleaded that it was and having testified that it was, the proof of this matter was therefore clearly within the issue, was so placed by the allegations of the complaint, the denial of these allegations in the answer, and was not new matter." (Italics ours.) (P. 860.)
 In the instant case, even if we accept the erroneous statement in defendant's brief that judgment was entered on the first cause of action for $755, it is clear that the "goods sold and delivered to said defendant" in the amount of $655.20, as alleged therein, did not include the straw, it having long since been delivered and paid for in full. Hence, any claim by defendant based upon the alleged condition of the straw was new matter and should have been pleaded.
 Judgment affirmed.
 Kaufman, P. J., and Shoemaker, J., concurred.
