
1 Cal.App.3d 156 (1969)
81 Cal. Rptr. 453
DAVIS COMPANY, Petitioner,
v.
THE SUPERIOR COURT OF SAN DIEGO COUNTY, Respondent; ESSEX CHEMICAL CORPORATION, Real Party in Interest.
Docket No. 9904.
Court of Appeals of California, Fourth District, Division One.
October 23, 1969.
*157 COUNSEL
Hervey & Mitchell, Hillyer & Irwin, and Michael F. Welch for Petitioner.
No appearance for Respondent.
Procopio, Cory, Hargreaves & Savitch and Paul B. Wells for Real Party in Interest.
*158 OPINION
COUGHLIN, J.
Essex Chemical Corporation sued Davis Company and others to recover the value of material furnished to and used by Davis in the performance of a subcontract in connection with the construction of San Diego stadium. Davis cross-complained for breach of warranty claiming the material furnished was not suitable for the purpose intended, as a result of which it sustained a loss in the sum of $23,405.02 because the defective material had to be removed and other material installed in its place. Essex moved for a summary judgment on the cross-complaint on the ground Davis was not a licensed contractor and thus was seeking recovery on an "illegal and void contract." The court granted the motion but allowed Davis to amend its pleadings to claim a set-off on account of the breach of warranty to the extent of Essex's claim. Davis seeks a writ of mandate directing the trial court to set aside its order granting the motion for partial summary judgment. Mandamus is a proper proceeding to review such an order. (Field Research Corp. v. Superior Court, 71 Cal.2d 110, 111 [77 Cal. Rptr. 243, 453 P.2d 747].)
The issue for determination is whether an unlicensed subcontractor may maintain an action for breach of warranty against a materialman furnishing material used by the subcontractor in performing his subcontract.
In California, by statute, a contractor must be licensed; it is unlawful, and a misdemeanor, for "any person to engage in the business or act in the capacity of a contractor ... without having a license therefor" (Bus & Prof. Code, § 7028); and a "person engaged in the business or acting in the capacity of a contractor" may not bring or maintain "any action in any court of this State for the collection of compensation for the performance of any act or contract for which a license is required" unless he was a duly licensed contractor at all times during the performance of such act or contract. (Bus. &. Prof. Code, § 7031.)
(1) The purpose of the licensing requirement is to protect the public from the perils incident to contracting with incompetent or untrustworthy contractors. (Lewis & Queen v. N.M. Ball Sons, 48 Cal.2d 141, 149-150 [308 P.2d 713]; Steinbrenner v. J.A. Waterbury Constr. Co., 212 Cal. App.2d 661, 666 [28 Cal. Rptr. 204]; Grant v. Weatherholt, 123 Cal. App.2d 34, 43 [266 P.2d 185].) The penalty provisions of the statute are construed and applied accordingly. The court will not impose penalties for noncompliance not provided by the statute. (S & Q Constr. Co. v. Palma Ceia Dev. Organization, 179 Cal. App.2d 364, 367-368 [3 Cal. Rptr. 690]; Grant v. Weatherholt, supra, 123 Cal. App.2d 34, 43.) (2) The penalty provision proscribing the maintenance of an action by an unlicensed *159 contractor is limited to an action "for the collection of compensation for the performance of any act or contract for which a license is required." (Bus. & Prof. Code, § 7031.) The term "compensation" as used in the statute "denotes sums claimed as an agreed price, fee or percentage earned by performance, and also sums claimed as the reasonable value of work done under implied contract." (Grant v. Weatherholt, supra, 123 Cal. App.2d 34, 43.) (3) The illegality attendant upon engaging in the business or acting in the capacity of a contractor without a license attaches only to transactions or contracts for construction and similar work described in Business and Professions Code sections 7026 and 7026.3, which define the activities of a person as a contractor subjecting him to the licensing requirement. (See S & Q Constr. Co. v. Palma Ceia Dev. Organization, supra, 179 Cal. App.2d 364, 367; Marshall v. Von Zumwalt, 120 Cal. App.2d 807, 810 [262 P.2d 363].) As a consequence, an unlicensed contractor may bring and maintain an action for the breach of a contract not within the scope of the protective purpose of the statute. (McCarroll v. Los Angeles County etc. Carpenters, 49 Cal.2d 45, 69 [315 P.2d 322]; Grant v. Weatherholt, supra, 123 Cal. App.2d 34, 43; Galich v. Brkich, 103 Cal. App.2d 187, 190, 191 [229 P.2d 89]; Norwood v. Judd, 93 Cal. App.2d 276, 286, 289 [209 P.2d 24].)
(4) In the case before the trial court Davis, by its cross-complaint, is not seeking compensation for the performance of its illegal contract with the prime contractor. That contract has been performed by all parties. When Davis removed the defective material supplied him by Essex and replaced it with adequate material, its action comported with that expected of a licensed contractor. The cause of action alleged in the cross-complaint arose out of the transaction between Davis as a purchaser and Essex as a seller of material; is premised upon the warranty by Essex the material furnished by it to Davis was fit for the purpose intended; and does not involve a transaction contemplated by the licensing requirements imposed upon contractors. The contract between Davis and the prime contractor is material to the case in the cross-complaint only as proof of circumstances under which Essex furnished and defendant received defective materials. (Cf. Grant v. Weatherholt, supra, 123 Cal. App.2d 34, 43.) The situation is not within the scope of the purpose of the licensing requirement.
In McCarroll v. Los Angeles County etc. Carpenters, supra, 49 Cal.2d 45, 69, the plaintiffs were engaged in the contracting business without a license and brought an action against defendant labor unions for breach of a labor contract, seeking damages and injunctive relief. The court rejected defendants' contention plaintiffs were barred from maintaining the action because they did not have a contractor's license, holding the validity of their labor contract was not related to the question whether they legally could enter into construction contracts; and their failure to obtain a license *160 was not ground for denying them relief from "breaches of contract other than contracts to recover compensation." The rationale of this decision dictates the conclusion the validity of the contract between Davis and Essex was not related to the construction contract between Davis and the prime contractor, and the failure of Davis to obtain a contractor's license does not bar its action for breach of the agreement by Essex to furnish material fit for the purpose intended.
Let a writ of mandate issue as prayed for.
Brown (Gerald), P.J., and Whelan, J., concurred.
A petition for a rehearing was denied on November 7, 1969, and the following opinion was then rendered:
THE COURT
Essex, in its petition for rehearing, expresses concern because this court did not distinguish or mention the decisions in Proffitt & Durnell Plumbing, Inc. v. David H. Baer Co., 247 Cal. App.2d 518, 521 [55 Cal. Rptr. 764] and Currie v. Stolowitz, 169 Cal. App.2d 810, 815 [338 P.2d 208], upon which it relies; and, as additional supporting authority, cites the recent decision in General Ins. Co. of America v. St. Paul Fire & Marine Ins. Co., [*](Cal. App.) 80 Cal. Rptr. 856. Suffice to say Essex misconceived the holdings in these cases, each of which, contrary to the situation at bench, involved a "contract for which a license is required." (Bus. & Prof. Code, § 7031.) A contract for the purchase and sale of materials is not a contract for which a license is required.
The petition of the real party in interest for a hearing by the Supreme Court was denied December 17, 1969.
NOTES
[*]   A rehearing was granted on October 16, 1969. The final opinion was filed on December 18, 1969, and certified for nonpublication.
